Compiling an ffmpeg that can transcode to MPEG

What is with multinational companies and their love affair with proprietary media formats? Is it too much to ask for support for an open format like Ogg? But oh no, they just have to go with closed formats, and we, suckers for their products that we are, have to go through all sorts of contortions to cram our videos into their devices.

Case in point: I am the recent recipient of an iPod Touch, and for the longest time, I have used nothing but Nokia cellphones. Hip and cool that may sound, but both the iPod Touch and Nokia cellphone unfortunately won't play AVI files or Ogg videos, only MP4s.

Alright, so why not use a product like ffmpeg to do the transcoding. Neat idea in theory, however, because of licensing restrictions, the ffmpeg in the Ubuntu repositories does not convert to MP4. Can you see me pulling out my hair now?

This has been a long-standing problem for me. Luckily, I stumbled on this neat how-to from Paul Battley. There's some recompilation of the ffmpeg code involved, but it's not too difficult. Since it's been written for Hardy, I thought I'd post my own steps for Jaunty.

First, install some dependencies:

sudo apt-get build-dep ffmpeg

sudo apt-get install libmp3lame-dev libfaad-dev libfaac-dev libxvidcore4-dev \
liba52-0.7.4 liba52-0.7.4-dev libx264-dev libdts-dev libgsm1-dev \
checkinstall build-essential subversion

Paul recommends getting the ffmpeg from source via Subversion:

svn checkout svn:// ffmpeg

However, an alternative is to download it from

Unzip the archive, if needed, and then enter the working directory:

cd ffmpeg

Then, run the configuration script:

./configure --enable-gpl --enable-postproc --enable-libvorbis \
--enable-libdc1394 --enable-libgsm --disable-debug --enable-libmp3lame \
--enable-libfaad --enable-libfaac --enable-libxvid --enable-pthreads \
--enable-libx264 --enable-nonfree

And then, compile the program:


Finally, to install the resulting package

sudo checkinstall

If you have the ffmpeg from the repositories, it won't necessarily conflict with this installed package; however, do note that this customized ffmpeg is installed at /usr/local/bin/ffmpeg.