Skip to content

Instantly share code, notes, and snippets.

@sparanoid
Created March 31, 2021 08:20
Show Gist options
  • Select an option

  • Save sparanoid/9eebc5d721d935f3d9d41f8d18200c21 to your computer and use it in GitHub Desktop.

Select an option

Save sparanoid/9eebc5d721d935f3d9d41f8d18200c21 to your computer and use it in GitHub Desktop.

Revisions

  1. sparanoid revised this gist Mar 31, 2021. 1 changed file with 18 additions and 16 deletions.
    34 changes: 18 additions & 16 deletions install-ffmpeg.sh
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,16 @@

    # Installs ffmpeg from source (HEAD) with libaom and libx265, as well as a few
    # other common libraries
    # binary will be at ~/bin/ffmpeg
    # binary will be at $BASE_DIR/bin/ffmpeg

    sudo apt update && sudo apt upgrade -y
    apt update && apt upgrade -y

    mkdir -p ~/ffmpeg_sources ~/bin
    export PATH="$HOME/bin:$PATH"
    BASE_DIR="/openbayes/home"

    sudo apt -y install \
    mkdir -p "$BASE_DIR/ffmpeg_sources" "$BASE_DIR/bin"
    export PATH="$BASE_DIR/bin:$PATH"

    apt -y install \
    autoconf \
    automake \
    build-essential \
    @@ -39,32 +41,32 @@ sudo apt -y install \
    libfdk-aac-dev

    # Install libaom from source.
    mkdir -p ~/ffmpeg_sources/libaom && \
    cd ~/ffmpeg_sources/libaom && \
    mkdir -p "$BASE_DIR/ffmpeg_sources/libaom" && \
    cd $BASE_DIR/ffmpeg_sources/libaom && \
    git clone https://aomedia.googlesource.com/aom && \
    cmake ./aom && \
    make && \
    sudo make install
    make install

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

    cd ~/ffmpeg_sources && \
    cd "$BASE_DIR/ffmpeg_sources" && \
    wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
    tar xjvf ffmpeg-snapshot.tar.bz2 && \
    cd ffmpeg && \
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$HOME/ffmpeg_build" \
    PKG_CONFIG_PATH="$BASE_DIR/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="$BASE_DIR/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I$HOME/ffmpeg_build/include" \
    --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
    --extra-cflags="-I$BASE_DIR/ffmpeg_build/include" \
    --extra-ldflags="-L$BASE_DIR/ffmpeg_build/lib" \
    --extra-libs="-lpthread -lm" \
    --bindir="$HOME/bin" \
    --bindir="$BASE_DIR/bin" \
    --enable-gpl \
    --enable-libass \
    --enable-libfdk-aac \
  2. @sparrc sparrc renamed this gist Apr 27, 2018. 1 changed file with 20 additions and 15 deletions.
    35 changes: 20 additions & 15 deletions install_ffmpeg_with_libaom.sh → install-ffmpeg.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    #!/usr/bin/env bash

    # ffmpeg will be installed into ~/bin/ffmpeg
    # Installs ffmpeg from source (HEAD) with libaom and libx265, as well as a few
    # other common libraries
    # binary will be at ~/bin/ffmpeg

    sudo apt update && sudo apt upgrade -y

    @@ -29,30 +31,29 @@ sudo apt -y install \
    texinfo \
    wget \
    zlib1g-dev \

    sudo apt -y install \
    yasm \
    libvpx-dev \
    libopus-dev \
    libx264-dev \
    libmp3lame-dev \
    libfdk-aac-dev

    # INSTALL NASM:
    cd ~/ffmpeg_sources && \
    wget 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

    # INSTALL LIBAOM
    # Install libaom from source.
    mkdir -p ~/ffmpeg_sources/libaom && \
    cd ~/ffmpeg_sources/libaom && \
    git clone https://aomedia.googlesource.com/aom && \
    cmake ./aom && \
    make && \
    sudo make install

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

    cd ~/ffmpeg_sources && \
    wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
    tar xjvf ffmpeg-snapshot.tar.bz2 && \
    @@ -66,6 +67,10 @@ cd ~/ffmpeg_sources && \
    --bindir="$HOME/bin" \
    --enable-gpl \
    --enable-libass \
    --enable-libfdk-aac \
    --enable-libmp3lame \
    --enable-libx264 \
    --enable-libx265 \
    --enable-libtheora \
    --enable-libfreetype \
    --enable-libvorbis \
    @@ -75,4 +80,4 @@ cd ~/ffmpeg_sources && \
    --enable-nonfree && \
    make && \
    make install && \
    hash -r
    hash -r
  3. @sparrc sparrc revised this gist Apr 26, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install_ffmpeg_with_libaom.sh
    Original file line number Diff line number Diff line change
    @@ -65,6 +65,9 @@ cd ~/ffmpeg_sources && \
    --extra-libs="-lpthread -lm" \
    --bindir="$HOME/bin" \
    --enable-gpl \
    --enable-libass \
    --enable-libtheora \
    --enable-libfreetype \
    --enable-libvorbis \
    --enable-libopus \
    --enable-libvpx \
  4. @sparrc sparrc revised this gist Apr 26, 2018. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install_ffmpeg_with_libaom.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    #!/usr/bin/env bash

    # ffmpeg will be installed into ~/bin/ffmpeg

    sudo apt update && sudo apt upgrade -y

    mkdir -p ~/ffmpeg_sources ~/bin
  5. @sparrc sparrc created this gist Apr 26, 2018.
    71 changes: 71 additions & 0 deletions install_ffmpeg_with_libaom.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    sudo apt update && sudo apt upgrade -y

    mkdir -p ~/ffmpeg_sources ~/bin
    export PATH="$HOME/bin:$PATH"

    sudo apt -y install \
    autoconf \
    automake \
    build-essential \
    cmake \
    git \
    libass-dev \
    libfreetype6-dev \
    libsdl2-dev \
    libtheora-dev \
    libtool \
    libva-dev \
    libvdpau-dev \
    libvorbis-dev \
    libxcb1-dev \
    libxcb-shm0-dev \
    libxcb-xfixes0-dev \
    mercurial \
    pkg-config \
    texinfo \
    wget \
    zlib1g-dev \

    sudo apt -y install \
    yasm \
    libvpx-dev \
    libopus-dev \

    # INSTALL NASM:
    cd ~/ffmpeg_sources && \
    wget 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

    # INSTALL LIBAOM
    mkdir -p ~/ffmpeg_sources/libaom && \
    cd ~/ffmpeg_sources/libaom && \
    git clone https://aomedia.googlesource.com/aom && \
    cmake ./aom && \
    make && \
    sudo make install

    cd ~/ffmpeg_sources && \
    wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
    tar xjvf ffmpeg-snapshot.tar.bz2 && \
    cd ffmpeg && \
    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 -lm" \
    --bindir="$HOME/bin" \
    --enable-gpl \
    --enable-libvorbis \
    --enable-libopus \
    --enable-libvpx \
    --enable-libaom \
    --enable-nonfree && \
    make && \
    make install && \
    hash -r