-
-
Save wolkenarchitekt/d130426ace2f4167067a34c3ec0839be to your computer and use it in GitHub Desktop.
Build FFmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on: https://gist.github.com/peerasan/8ee6df7df6ed764c606f99d245e74211 | |
set -euxo pipefail | |
BUILD_DIR="/usr/local/src/ffmpeg" | |
BIN_DIR="$HOME/bin" | |
mkdir -p ${BUILD_DIR} ${BIN_DIR} | |
cd "${BUILD_DIR}" | |
#Require for Compiler | |
apt-get install -y autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev meson ninja-build pkg-config texinfo wget yasm zlib1g-dev | |
#Require for FFmpeg | |
apt-get install nasm libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev libunistring-dev | |
#libaom | |
cd "${BUILD_DIR}" | |
git -C aom pull 2> /dev/null || git clone --depth 1 https://aomedia.googlesource.com/aom | |
mkdir -p aom_build | |
cd aom_build | |
PATH="$BIN_DIR:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$BUILD_DIR" -DENABLE_SHARED=off -DENABLE_NASM=on ../aom | |
PATH="$BIN_DIR:$PATH" make -j 8 | |
make install | |
#libsvtav1 | |
cd "${BUILD_DIR}" | |
git -C SVT-AV1 pull 2> /dev/null || git clone https://gitlab.com/AOMediaCodec/SVT-AV1 | |
mkdir -p SVT-AV1/build | |
cd SVT-AV1/build | |
PATH="$BIN_DIR:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF .. | |
PATH="$BIN_DIR:$PATH" make -j 8 | |
make install | |
#ffmpeg | |
cd "${BUILD_DIR}" | |
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 | |
tar xjvf ffmpeg-snapshot.tar.bz2 | |
cd ffmpeg | |
PATH="$BIN_DIR:$PATH" PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" ./configure \ | |
--prefix="${BUILD_DIR}" \ | |
--pkg-config-flags="--static" \ | |
--extra-cflags="-I${BUILD_DIR}/include" \ | |
--extra-ldflags="-L${BUILD_DIR}/lib" \ | |
--extra-libs="-lpthread -lm" \ | |
--bindir="$BIN_DIR" \ | |
--enable-gpl \ | |
--enable-gnutls \ | |
--enable-libaom \ | |
--enable-libass \ | |
--enable-libfdk-aac \ | |
--enable-libfreetype \ | |
--enable-libmp3lame \ | |
--enable-libopus \ | |
--enable-libsvtav1 \ | |
--enable-libvorbis \ | |
--enable-libvpx \ | |
--enable-libx264 \ | |
--enable-libx265 \ | |
--enable-nonfree | |
PATH="$BIN_DIR:$PATH" make -j8 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment