Skip to content

Instantly share code, notes, and snippets.

@whisk
Last active January 10, 2018 11:37
Show Gist options
  • Save whisk/41441c49c2609856264fe850488a47ee to your computer and use it in GitHub Desktop.
Save whisk/41441c49c2609856264fe850488a47ee to your computer and use it in GitHub Desktop.
building ffmpeg statically with x264 and libfdk_aac
# for Debian 9 (Stretch)
# roughly based on https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
sudo apt-get -y install pkg-config git build-essential autoconf libtool
cd $HOME/src/fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffbuild" --disable-shared
make && make install
cd $HOME/src/x264
./configure --prefix=$HOME/ffbuild --enable-static --disable-cli --enable-pic # PIC is important
make && make install
cd $HOME/src/FFmpeg
PKG_CONFIG_PATH="$HOME/ffbuild/lib/pkgconfig" \
./configure --pkg-config-flags="--static" \
--prefix=$HOME/ffbuild \
--extra-cflags="-I$HOME/ffbuild/include" \
--extra-ldflags="-L$HOME/ffbuild/lib" \
--extra-libs="-lpthread -lm -ldl" \ # dl is important
--enable-gpl --enable-libfdk-aac --enable-libx264 --enable-nonfree
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment