I'm a total control freak at times. This means I'm trying to make a screencast where I'm recording the audio track separately. This is the first time I'm doing anything like that, so I'm still exploring software options.
A lot of people pointed to RecordMyDesktop, saying it is good, and don't get me wrong, it is. It just isn't intended for serious production.
The reason RecordMyDesktop videos go out of sync is, as many people have noticed, that it drops frames. Many people seem to think it's a bug that it does, but that isn't true. It intentionally drops frames where nothing is moving. The reason it does this is that if you pre-record your screen and then want to overlay voice, you usually want to eliminate dead time in the video. It gives you smaller file sizes and you can just stretch a frame if you need extra time to talk somewhere anyway.
There is an option along the lines of "record full frames every frame" which is apparently unrelated to this frame dropping behaviour, and probably controls key frames. That's a shame because RecordMyDesktop was really good until I realised it's useless to me.
The software option that has been working decently so far has been to record the video with ffmpeg, record the audio with Audacity and then combine the two with OpenShot.