Skip to content

Instantly share code, notes, and snippets.

@kauld
Forked from freedomlang/install-ffmpeg-centos.sh
Last active November 6, 2022 18:13
Show Gist options
  • Save kauld/379a269c4bc24e152b4b002875fd8676 to your computer and use it in GitHub Desktop.
Save kauld/379a269c4bc24e152b4b002875fd8676 to your computer and use it in GitHub Desktop.

Revisions

  1. kauld renamed this gist Nov 6, 2022. 1 changed file with 26 additions and 25 deletions.
    51 changes: 26 additions & 25 deletions install-ffmpeg-centos.sh → install-ffmpeg-fedora.sh
    Original file line number Diff line number Diff line change
    @@ -4,99 +4,99 @@ if [ "`/usr/bin/whoami`" != "root" ]; then
    echo "You need to execute this script as root."
    exit 1
    fi

    INSTALL_DIR="./builds/ffmpeg"
    ###############################################################################
    # ffmpeg installer for centos 7
    # based on instructions at https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
    ###############################################################################

    yum install -y autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel

    mkdir ~/ffmpeg_sources
    mkdir ~/$INSTALL_DIR/ffmpeg_sources

    # NASM
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
    tar xjvf nasm-2.14.02.tar.bz2
    cd nasm-2.14.02
    ./autogen.sh
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --bindir="$HOME/$INSTALL_DIR/bin"
    make
    make install

    # Yasm
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
    tar xzvf yasm-1.3.0.tar.gz
    cd yasm-1.3.0
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --bindir="$HOME/$INSTALL_DIR/bin"
    make
    make install

    # libx264
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    git clone --depth 1 https://code.videolan.org/videolan/x264.git
    cd x264
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
    PKG_CONFIG_PATH="$HOME/$INSTALL_DIR/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --bindir="$HOME/$INSTALL_DIR/bin" --enable-static
    make
    make install

    # libx265
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    hg clone https://bitbucket.org/multicoreware/x265
    cd ~/ffmpeg_sources/x265/build/linux
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
    cd ~/$INSTALL_DIR/ffmpeg_sources/x265/build/linux
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/$INSTALL_DIR/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
    make
    make install

    # libfdk_aac
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    git clone --depth 1 https://github.com/mstorsjo/fdk-aac
    cd fdk-aac
    autoreconf -fiv
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --disable-shared
    make
    make install

    # libmp3lame
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
    tar xzvf lame-3.100.tar.gz
    cd lame-3.100
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --bindir="$HOME/$INSTALL_DIR/bin" --disable-shared --enable-nasm
    make
    make install

    # libopus
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
    tar xzvf opus-1.3.1.tar.gz
    cd opus-1.3.1
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --disable-shared
    make
    make install

    # libvpx
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
    cd libvpx
    ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
    ./configure --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
    make
    make install

    # ffmpeg itself
    cd ~/ffmpeg_sources
    cd ~/$INSTALL_DIR/ffmpeg_sources
    curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
    tar xjvf ffmpeg-snapshot.tar.bz2
    cd ffmpeg
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$HOME/ffmpeg_build" \
    PATH="$HOME/$INSTALL_DIR/bin:$PATH" PKG_CONFIG_PATH="$HOME/$INSTALL_DIR/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$HOME/$INSTALL_DIR/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$HOME/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
    --extra-cflags="-I$HOME/$INSTALL_DIR/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/$INSTALL_DIR/ffmpeg_build/lib" \
    --extra-libs=-lpthread \
    --extra-libs=-lm \
    --bindir="$HOME/bin" \
    --bindir="$HOME/$INSTALL_DIR/bin" \
    --enable-gpl \
    --enable-libfdk_aac \
    --enable-libfreetype \
    @@ -109,4 +109,5 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    make
    make install

    sudo ln -s /usr/bin/ffmpeg $HOME/$INSTALL_DIR/bin/ffmpeg -y

  2. @freedomlang freedomlang revised this gist Nov 14, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,14 @@
    # Copied from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
    #!/bin/bash

    if [ "`/usr/bin/whoami`" != "root" ]; then
    echo "You need to execute this script as root."
    exit 1
    fi

    ###############################################################################
    # ffmpeg installer for centos 7
    # based on instructions at https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
    ###############################################################################

    yum install -y autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel

  3. @freedomlang freedomlang revised this gist Nov 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Copied from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

    yum install -y autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel
    yum install -y autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel

    mkdir ~/ffmpeg_sources

  4. @freedomlang freedomlang revised this gist Nov 14, 2019. 1 changed file with 9 additions and 29 deletions.
    38 changes: 9 additions & 29 deletions install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -6,17 +6,17 @@ mkdir ~/ffmpeg_sources

    # NASM
    cd ~/ffmpeg_sources
    curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
    tar xjvf nasm-2.13.02.tar.bz2
    cd nasm-2.13.02
    curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
    tar xjvf nasm-2.14.02.tar.bz2
    cd nasm-2.14.02
    ./autogen.sh
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    make
    make install

    # Yasm
    cd ~/ffmpeg_sources
    curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
    curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
    tar xzvf yasm-1.3.0.tar.gz
    cd yasm-1.3.0
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    @@ -25,7 +25,7 @@ make install

    # libx264
    cd ~/ffmpeg_sources
    git clone --depth 1 http://git.videolan.org/git/x264
    git clone --depth 1 https://code.videolan.org/videolan/x264.git
    cd x264
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
    make
    @@ -50,7 +50,7 @@ make install

    # libmp3lame
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
    curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
    tar xzvf lame-3.100.tar.gz
    cd lame-3.100
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
    @@ -59,31 +59,13 @@ make install

    # libopus
    cd ~/ffmpeg_sources
    curl -O -L https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
    tar xzvf opus-1.2.1.tar.gz
    cd opus-1.2.1
    curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
    tar xzvf opus-1.3.1.tar.gz
    cd opus-1.3.1
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libogg
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.gz
    tar xzvf libogg-1.3.3.tar.gz
    cd libogg-1.3.3
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libvorbis
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
    tar xzvf libvorbis-1.3.5.tar.gz
    cd libvorbis-1.3.5
    ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libvpx
    cd ~/ffmpeg_sources
    git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
    @@ -110,11 +92,9 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    --enable-libfreetype \
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
    --enable-static \
    --enable-nonfree
    make
    make install
  5. @freedomlang freedomlang revised this gist Nov 14, 2019. No changes.
  6. @freedomlang freedomlang revised this gist Nov 14, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -118,6 +118,5 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    --enable-nonfree
    make
    make install
    hash -r


  7. @cbosco cbosco revised this gist Jun 7, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -114,6 +114,7 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
    --enable-static \
    --enable-nonfree
    make
    make install
  8. @cbosco cbosco revised this gist Jun 7, 2018. 1 changed file with 0 additions and 10 deletions.
    10 changes: 0 additions & 10 deletions install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -84,15 +84,6 @@ cd libvorbis-1.3.5
    make
    make install

    # libtheora
    cd ~/ffmpeg_sources
    curl -O -L https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.tar.gz
    tar xzvf libtheora-1.1.1.tar.gz
    cd lbtheora-1.1.1
    ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libvpx
    cd ~/ffmpeg_sources
    git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
    @@ -120,7 +111,6 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libvorbis \
    # --enable-libtheora \ (TODO: re-enable once fixed?)
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
  9. @cbosco cbosco revised this gist Jun 7, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -120,7 +120,7 @@ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./conf
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libtheora \
    # --enable-libtheora \ (TODO: re-enable once fixed?)
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
  10. @cbosco cbosco created this gist Jun 7, 2018.
    132 changes: 132 additions & 0 deletions install-ffmpeg-centos.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,132 @@
    # Copied from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

    yum install -y autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel

    mkdir ~/ffmpeg_sources

    # NASM
    cd ~/ffmpeg_sources
    curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2
    tar xjvf nasm-2.13.02.tar.bz2
    cd nasm-2.13.02
    ./autogen.sh
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    make
    make install

    # Yasm
    cd ~/ffmpeg_sources
    curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
    tar xzvf yasm-1.3.0.tar.gz
    cd yasm-1.3.0
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
    make
    make install

    # libx264
    cd ~/ffmpeg_sources
    git clone --depth 1 http://git.videolan.org/git/x264
    cd x264
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
    make
    make install

    # libx265
    cd ~/ffmpeg_sources
    hg clone https://bitbucket.org/multicoreware/x265
    cd ~/ffmpeg_sources/x265/build/linux
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
    make
    make install

    # libfdk_aac
    cd ~/ffmpeg_sources
    git clone --depth 1 https://github.com/mstorsjo/fdk-aac
    cd fdk-aac
    autoreconf -fiv
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libmp3lame
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
    tar xzvf lame-3.100.tar.gz
    cd lame-3.100
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
    make
    make install

    # libopus
    cd ~/ffmpeg_sources
    curl -O -L https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
    tar xzvf opus-1.2.1.tar.gz
    cd opus-1.2.1
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libogg
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.gz
    tar xzvf libogg-1.3.3.tar.gz
    cd libogg-1.3.3
    ./configure --prefix="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libvorbis
    cd ~/ffmpeg_sources
    curl -O -L http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
    tar xzvf libvorbis-1.3.5.tar.gz
    cd libvorbis-1.3.5
    ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libtheora
    cd ~/ffmpeg_sources
    curl -O -L https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.tar.gz
    tar xzvf libtheora-1.1.1.tar.gz
    cd lbtheora-1.1.1
    ./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
    make
    make install

    # libvpx
    cd ~/ffmpeg_sources
    git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
    cd libvpx
    ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm
    make
    make install

    # ffmpeg itself
    cd ~/ffmpeg_sources
    curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
    tar xjvf ffmpeg-snapshot.tar.bz2
    cd ffmpeg
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$HOME/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$HOME/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
    --extra-libs=-lpthread \
    --extra-libs=-lm \
    --bindir="$HOME/bin" \
    --enable-gpl \
    --enable-libfdk_aac \
    --enable-libfreetype \
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libtheora \
    --enable-libvpx \
    --enable-libx264 \
    --enable-libx265 \
    --enable-nonfree
    make
    make install
    hash -r