After struggling through trying to get RecordMyDesktop, Istanbul, byzanz, and a few other lesser known Linux or UNIX screen capture programs working on Debian Wheezy with sound, I just broke down and wrote my own using ffmpeg.
So, here it is: screencast.sh
This script will prompt you to click a window, then it sorts out where that window is and how big it is, and spits out a ffmpeg line that will capture that section of the screen.
If you find that copying and pasting the command into the terminal and running it makes a perfect screencast, you can remove the “echo” part of the script and it will just do the whole thing for you.
In the interactive ffmpeg window that starts scrolling by when recording starts, type “q” to stop the recording.