Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories


How to install ffmpeg with H.264/MPEG-4 AVC

Ástþór IPÁstþór IP

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.

1. Add the deb-multimedia.org to apt sources

echo "deb http://www.deb-multimedia.org squeeze main non-free" >> /etc/apt/sources.list

2. Update apt and install deb-multimedia keyring

apt-get update
apt-get install deb-multimedia-keyring
apt-get update

3. Remove the Debian ffmpeg package if you have already installed it

apt-get remove ffmpeg

4. Install ffmpeg and x264

apt-get install ffmpeg x264

5. 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

Comments 3
  • Jon
    Posted on

    Jon Jon

    Author

    Thank you so much for this. Been having nightmares getting libx264 working but your solution was the shortest and worked straight away!


  • Sebastian
    Posted on

    Sebastian Sebastian

    Author

    Thanks very much!!!


  • Davide
    Posted on

    Davide Davide

    Author

    I’ve a problem with IPCAM(HD Cam ) config with Motion in raspbian. Now I’ve to use vlc to see the streaming video. Installing the new codec is there a way to bypass the problem? Thks