Screencasting in Ubuntu 13.04

Even if in the past I have been quite satisfied with xvidcap and other software, I tried recordmydesktop (aptitude install it) that can be invoked from the command line and starts recording, saving the output in ogv format.

To convert the file in MP4 the command that worked for me is:

ffmpeg -i out.ogv -acodec libmp3lame -ab 128k -ac 2 -vcodec libx264 -crf 22 -threads 0 file.mp4

(provided that ffmpeg is already installed, of course)