Skip to content

Instantly share code, notes, and snippets.

@jeffreywescott
Created August 11, 2014 23:04
Show Gist options
  • Save jeffreywescott/9fb18ca5102b824a654a to your computer and use it in GitHub Desktop.
Save jeffreywescott/9fb18ca5102b824a654a to your computer and use it in GitHub Desktop.
Use pre-built Ubuntu packages for a lot of the dependent libraries when building ffmpeg.

How to Build FFmpeg on Ubuntu

There is an official guide out there, but it ignores the fact that it's possible to use pre-build packages for a lot of the dependent libraries (rather than compiling them). This set of instructions aims to fix that.

Procedure

# ensure "non-free" packages are available
$ sudo vi /etc/apt/sources.list  # uncomment "multiverse" URLs
$ sudo apt-get update
# install build / compilation tools
$ sudo apt-get install make
$ sudo apt-get install yasm
# install fpm packaging tool
$ sudo apt-get install ruby-dev
$ sudo gem install fpm
# install codecs / libraries
$ sudo apt-get install libx264-dev
$ sudo apt-get install libfdk-aac-dev
$ sudo apt-get install libfaac-dev
$ sudo apt-get install libspeex-dev
$ sudo apt-get install libfreetype6-dev
# download and build ffmpeg source
$ cd $HOME
$ mkdir $HOME/ffmpeg_build
$ wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
$ tar xjvf ffmpeg-snapshot.tar.bz2
$ cd $HOME/ffmpeg
$ ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --enable-gpl \
  --enable-libfdk-aac \
  --enable-libfaac \
  --enable-libfreetype \
  --enable-libspeex \
  --enable-libx264 \
  --enable-nonfree
$ make && make install
# make it into a .deb package
$ fpm -s dir -t deb -n ffmpeg -v 2.3-git \
  -d x264 \
  -d libfdk-aac0 \
  -d libfaac0 \
  -d libspeex1 \
  -d libfreetype6 \
  $HOME/ffmpeg_build/=/usr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment