The Ubuntu repositories will give you a crippled, antiquated version of ffmpeg. Here’s the latest in my occasional series of explanations of how to get a newer, better, more full-featured version.

First, make sure that your system is up-to-date:

sudo apt-get update
sudo apt-get upgrade

Next, get your dependencies:

sudo apt-get build-dep ffmpeg
sudo apt-get install liblame-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

Grab the ffmpeg source:

svn co -r 14946 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

Patch ffmpeg to work with Hardy’s slightly older x264 library (i.e. remove TESA support):

cd ffmpeg
wget http://po-ru.com/files/ffmpeg-14946-hardy.patch
patch -p0 < ffmpeg-14946-hardy.patch

Configure and build:

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

And install (I set the version to 3:1.svn14946):

sudo checkinstall

It works for me, but if I’ve missed a step or a dependency, shout in the comments.