I have blogged this, but now I want to write a new instruction for compiling ffmpeg for use in Ubuntu. The standard ffmpeg is a little hindered due to the restrictions on what can be included in the standard repositories.
sudo apt-get build-dep ffmpeg
sudo apt-get install liblame-dev libfaad2-dev \
libfaac-dev libxvidcore4-dev checkinstall fakeroot
DEB_BUILD_OPTIONS=risky fakeroot apt-get source ffmpeg --compile
Now install all the deb packages that are created. A little finer control could be exercised if instead of setting DEB_BUILD_OPTIONS, the
debian/rules file can be edited.