# From the official ffmpeg docs
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libvorbis-dev pkg-config texinfo zlib1g-dev \
yasm libx264-dev libmp3lame-dev libvpx-dev libfdk-aac-dev
NASM assembler. Required for compilation of x264 and other tools.
cd ~/ffmpeg_sources
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2
tar xjvf nasm-2.13.01.tar.bz2
cd nasm-2.13.01
./autogen.sh
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
PATH="$HOME/bin:$PATH" make
make install
Requires ffmpeg to be configured with --enable-gpl
and --enable-libx264
.
cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-opencl
PATH="$HOME/bin:$PATH" make
make install
H.265/HEVC video encoder. Requires ffmpeg to be configured with --enable-libx265
.
sudo apt-get install cmake mercurial
cd ~/ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265
cd ~/ffmpeg_sources/x265/build/linux
PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source
make
make install
AAC audio encoder. Requires ffmpeg to be configured with --enable-libfdk-aac
(and --enable-nonfree
if you also included --enable-gpl
).
sudo apt-get install libfdk-aac-dev
Opus is an audio decoder and encoder. Requires ffmpeg to be configured with --enable-libopus
.
cd ~/ffmpeg_sources
wge https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
tar xzvf tar xzvf opus-1.2.1.tar.gz
cd opus-1.2.1/
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
VP8/VP9 video encoder and decoder. Requires ffmpeg to be configured with --enable-libvpx
.
wget http://ffmpeg.org/releases/ffmpeg-3.4.tar.bz2
tar xjvf ffmpeg-3.4.tar.bz2
cd ffmpeg-3.4/
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 \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
PATH="$HOME/bin:$PATH" make
make install
hash -r
In order to create a debian package we can use checkinstall:
checkinstall -D --install=no
The fastest way to do it is to add the ubuntu-media PPA, install version 3.3, then remove it and install ours 3.4.
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg -y
sudo dpkg -r ffmpeg
sudo dpkg -i ffmpeg_3.4-2-1_amd64.deb