I use ffmpeg to record a window using this code:
ffmpeg.exe -f dshow -y -i video=\"screen-capture-recorder\":audio=\"virtual-audio-capturer\":audio=\"Microphon
This example works for me:
ffmpeg -f gdigrab -framerate 30 -i title="german.avi - VLC media player" -b:v 3M germ.flv
where "title" means actual title of a target window.
Hope this will help.