Edouard Gomez did a great job on pushing my x11grab patch into ffmpeg. He smoothed all rough edges ranging from my blunt ignorance of the ffmpeg coding guidelines to obvious hacks without any remorse.
The patch series hit ffmpeg svn on 20061212. Get it from here. You have to run configure with
--enable-gplto get the GPL-ed x11grab implementation.
To actually start grabbing, run
ffmpeg -vcodec mpeg4 -qscale 2 -r 10 -vd x11:0+0,0 -s 1280x1024 whatever.avi
You might replace 1280x1024 by your actual screen resolution.