I recently programmed a very simple wrapper around byzanz-record. It is called recordselectedwindow and it can be used for recording windows that are selected with mouse. It outputs .gif files. The window information is obtained using the tools xdotool and xwininfo for X. The duration for recording can be supplied as a command line argument.

recordselectedwindow can be obtained here.