Table of Contents
Ubuntu - Video - Install ffmpeg with H.264/MPEG-4 AVC (Advanced Video Coding)
H.264/MPEG-4 Part 10 or AVC (Advanced Video Coding) is a standard for video compression, and is currently one of the most commonly used formats for the recording, compression, and distribution of high definition video.
The ffmpeg package provided by Debian repositories doesn’t support H.264 due to patent restrictions. Luckily deb-multimedia.org provides a ffmpeg package compiled with H.264 support and it’s very easy to install.
NOTE: This is only needed if ffmpeg does not currently support H264.
To check if ffmpeg currently does have H264 support:
ffmpeg -version
If you can see “–enable-libx264”, it does have H.264 support, so no need to continue.
Add the deb-multimedia.org to apt sources
echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list
Update apt and install deb-multimedia keyring
apt-get update apt-get install deb-multimedia-keyring apt-get update
Remove the Debian ffmpeg package if you have already installed it
sudo apt remove ffmpeg
Install ffmpeg and x264
sudo apt install ffmpeg x264
Check
To check if ffmpeg was correctly installed run this command
ffmpeg -version
The output should be similar to this.
If you can see “–enable-libx264”, you have H.264 support.
ffmpeg version 0.7.13, Copyright (c) 2000-2011 the FFmpeg developers built on Jun 13 2012 14:14:09 with gcc 4.4.5 configuration: --enable-libdc1394 --prefix=/usr --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-avfilter --enable-libdirac --disable-decoder=libdirac --enable-libfreetype --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --extra-libs=-lgcrypt --disable-altivec --disable-armv5te --disable-armv6 --disable-vis libavutil 50. 43. 0 / 50. 43. 0 libavcodec 52.123. 0 / 52.123. 0 libavformat 52.111. 0 / 52.111. 0 libavdevice 52. 5. 0 / 52. 5. 0 libavfilter 1. 80. 0 / 1. 80. 0 libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0 ffmpeg 0.7.13 libavutil 50. 43. 0 / 50. 43. 0 libavcodec 52.123. 0 / 52.123. 0 libavformat 52.111. 0 / 52.111. 0 libavdevice 52. 5. 0 / 52. 5. 0 libavfilter 1. 80. 0 / 1. 80. 0 libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0