Encoding videos can be a real pain. While ffmpeg is an excellent utility for converting videos between various formats it is also a pain to use. If you put H.264 codec on top of this, you will get a real mess with command lines that are longer than 200 characters. H.264 is a great format and linux implementation is hiding in the libx264. It will come pre-installed with Ubuntu 10.04, but if you are more adventurous you should try and install the latest versions from SVN repositories as described on Ubuntu forums. The whole procedure is quite easy and very well documented so in this post I will assume that you have installed the latest versions.
The focus of this test and tutorial will be on video production, more specifically on an average YouTube Vlogger video. This means, one pass encoding, high compression and very uniform videos. For encoding movies and other videos with very dynamic content and big changes in the scenes you will have to look elsewhere of wait for another post. :)