Hello folks. Today we will see a excellent software that permit us to manipulate audio and videos files.
FFmpeg is a free software that permit us to record, convert and stream audio and video. It provide support for most existing file formats like AVI, MPEG, OGG, etc. and encoding formats like MPEG, DivX, MPEG4, etc. When you installed it from repository, it does not come with some encodes enabled like x264, vorbis and between others. So, to enable them, we need to compile it
Open a terminal and run:
sudo apt-get remove libmp3lame-dev ffmpeg
sudo apt-get install quilt libsdl1.2-dev libogg-dev libvorbis-dev liba52-dev libdts-dev libimlib2-dev texi2html libraw1394-dev libdc1394-22-dev libtheora-dev libgsm1-dev libxvidcore-dev libfaac-dev libfaad-dev build-essential git-core checkinstall yasm texi2html libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev zlib1g-dev nasm
The command above will remove the libmp3lame-dev to avoid conflict and install the dependencies to compile ffmpeg and to enable the encoding. In this post we will compile the latest ffmpeg and x264 version, so let’s donwload x264 from git and compile it. Still in the terminal, type:
cd
mkdir ffmpeg-source
cd ffmpeg-source
git clone git://git.videolan.org/x264
cd x264
./configure
make -j3
sudo checkinstall --pkgname=x264 --default --pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes
Remember that, the option -j3 depends the numbers of cores or processors from your computer. X264 enables for encoding video streams into the H.264/MPEG-4 AVC.
Now, let’s do the same thing with lame.
cd ~/ffmpeg-source
sudo mkdir -p /usr/local/share/doc/lame
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
tar xzvf lame-3.98.4.tar.gz
cd lame-3.98.4
./configure --enable-nasm --disable-shared
make -j3
sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no --default --deldoc=yes
Lame enables for encoding mp3 audio.
Another interesting encoding to be installed is the VP8 video. In the terminal run:
cd ~/ffmpeg-source
git clone git://review.webmproject.org/libvpx
cd libvpx
./configure
make -j3
sudo checkinstall --pkgname=libvpx --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no --default --deldoc=yes
Finally, it’s time to download, compile and install ffmpeg. Still in the terminal, run:
cd ~/ffmpeg-source
git clone git://git.videolan.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx
make -j3
sudo checkinstall --pkgname=ffmpeg --pkgversion="0.6.3-git" --backup=no --deldoc=yes --default
hash x264 ffmpeg ffplay ffprobe
After that, you have the ffmpeg installed with a great numbers of encoding enabled. To verify if everything is ok, type in the terminal:
ffmpeg -version
You will see something like that:
ffmpeg version git-N-29730-g6841c8c, Copyright (c) 2000-2011 the FFmpeg developers
built on May 9 2011 00:00:10 with gcc 4.6.1 20110429 (prerelease)
configuration: --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx
libavutil 51. 2. 1 / 51. 2. 1
libavcodec 53. 5. 0 / 53. 5. 0
libavformat 53. 0. 3 / 53. 0. 3
libavdevice 53. 0. 0 / 53. 0. 0
libavfilter 2. 5. 0 / 2. 5. 0
libswscale 0. 14. 0 / 0. 14. 0
libpostproc 51. 2. 0 / 51. 2. 0
ffmpeg git-N-29730-g6841c8c
libavutil 51. 2. 1 / 51. 2. 1
libavcodec 53. 5. 0 / 53. 5. 0
libavformat 53. 0. 3 / 53. 0. 3
libavdevice 53. 0. 0 / 53. 0. 0
libavfilter 2. 5. 0 / 2. 5. 0
libswscale 0. 14. 0 / 0. 14. 0
libpostproc 51. 2. 0 / 51. 2. 0
Note that, the item configuration displays the same line typed in the command “./configure” in ffmpeg compilation, in other words, everything was compiled with success.
If you want to get more information about ffmpeg, access the site www.ffmpeg.org.
That’s it. See you next time.

