Roll your own ffmpeg build

I like to have my own build of ffmpeg. That way I don't have to worry about not having this or that codec available. What I do is keep it in my ~/Applications/ffmpeg folder. Some people suggest using a ~/bin directory but I hate to drop every binary into the same place.

Here are the magic lines:


cd ~/Applications

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

cd ffmpeg

sudo apt-get install libmp3lame-dev libfaad-dev libfaac-dev\
 libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev\
 libtheora-dev libvorbis-dev

./configure --enable-gpl --enable-nonfree --enable-libmp3lame\
--enable-libfaac --enable-libfaad --enable-libtheora \
--enable-libvorbis --enable-libx264 --enable-libxvid

make

Once that finishes, you get an ffmpeg executable in the ~/Applications/ffmpeg folder. So you can explicitly call from your scripts with ~/Applications/ffmpeg/ffmpeg. And because it has a ton of enabled codecs, it's less problematic to read videos from different sources than it is with the default build which comes with Ubuntu. Or even output videos using codecs such as mp3.

This will probably surely fail in a future version of Ubuntu, but it works as of today. Of course, if the libraries' names change, you'll have to adjust as appropriate too. It might also fail if the very svn checkout you do is not compiling properly, but hey! that's the fun of living in the bleeding edge :-P