None of my computers are fast enough for a full capture. So I just use avconv (a fork of ffmpeg). Caveats with audio and video frames resulting in different length streams, which should be compensated for to keep A/V sync. Since I can only safely do about 5 fps on a good day for capture, it's easier to fiddle with the frame counts for a 30fps destination.
Under load audio can get choppy, so to play it safe you might want to launch the things that you're recording with a high nice level (prefix them with nice -n 18 on the CLI, nice levels run -20 (kernel) to +20). Or renice the recording to a higher priority than X with renice (requires root priviledges for < 0 nice levels). With a half decent computer these steps might not be necessary. Although saving the output to a dedicated storage device would still be a good idea to avoid the competition.
The X code is a bit unreadable to some coders, so if you want to record the mouse cursor, that seems to only be supported in 24 bit or higher colors. So if you're recording at 16 bit (DefaultDepth 16 or -depth 16 for startx) and not getting a mouse cursor, it may have nothing to do with your recording application.
Code:
$ avconv -f alsa -i defaults -f x11grab -s 1920x1080 -r:v 5 -draw_mouse 1 -i :0.0 -q 0 -ac 2 -ar 48000 -acodec flac -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -r:v 5 -y recording.mkv
Paraphrased from one of my youtube videos (CLI heavy). Dropping the specs for audio might help it work if it complains. And I think -draw_mouse is now -mouse. And other quirks depending on your platform, system specs, and installed bits.
Such efforts on a raspberry pi running debian jessie armel (optimized for armv4), only gets me about one frame every 2 seconds. At which point it's better just to take screen shots and compile that to a video in post.
Code:
$ while true; do scrot '%Y%m%d%H%M%S_screenshot.png'; sleep 5; done