For 5 minutes requires 16GB of disk space and fast hard drive(s).
gst-launch ximagesrc use-damage=false num-buffers=4800 ! video/x-raw-rgb,framerate=15/1 ! ffmpegcolorspace ! avimux ! filesink location=desktop-raw.avi
Encode.
for PASS in 1 2 3; do mencoder desktop-raw.avi -oac pcm -ovc x264 -o desktop-big.avi -x264encopts bitrate=800:pass=$PASS done