- Install Pulseaudio because ALSA won’t record sound from your integrated on-board sound card :(
- In pavucontrol, show all recording devices and activate the one that reacts when games make sounds, so that Internal Audio is set as fallback (shield icon)
- Start game
- wmctrl -r GameWindowTitle -e 0,0,0,1280,720
- ffmpeg -f alsa -i pulse -f x11grab -acodec pcm_s16le -r 30 -s 1280x720 -i :0.0+1280x720 -vcodec libx264 -crf 0 -preset ultrafast -threads 0 out.mkv
- Edit/encode in kdenlive
Some alternatives, problems, solutions and discussions of this and similar methods can be found on:
Got questions? Ask below. :) Suggestions welcome too!
Nikki and the Robots: Story Episodes
Buy the cute Überpixel™ style platformer now!
outrageously blatant self-promotion

I’ve had problems encoding glc with libx264. Did you have to compile ffmpeg yourself to get it working?
No but I used arch linux’s version.
What is your problem?
I haven’t tried recently, but encoding my GLC captures stopped working a while back when I updated to a new version of Ubuntu – I started getting “unknown encoder” errors for libx264. Apparently hand-compiling can work for Ubuntu, but didn’t help me :-/
Sounds like libx264 (or the audio encoder) is missing or has the wrong name.
You could try using another encoder, for example libvpx (webm) and use a suitable preset (should be at /usr/share/ffmpeg/ ).
Feel free to email or continue this thread for a step by step help from me to you if you want to try recording something right now :)
I was getting some good results with gtk-recordmydesktop for a while, but then for no apparent reason it just stop working :-/
I had another crack at your method – here’s what I came up with:
wmctrl -r Black\ Dog -e 0,0,0,640,360
ffmpeg -f alsa -i pulse -f x11grab -acodec pcm_s16le -r 30 -s 640×360 -i :0.0+0×0 -vcodec libx264 -crf 0 -vpre lossless_ultrafast -threads 0 out.mkv
I’d managed to get x264 working in the meantime, so now problem there. Had to change the preset though. All told it works great, thanks ;)