Record my desktop with ffmpeg

It seems that desktop recording is quite the pest. Not that I’ve tried much, but I also haven’t really found a “go-to” piece of software for X11 that just does it. So the last time I wanted to record my screen, I decided to have a go with just plain command-line tools.

It turns out that this is also ridiculously easy.

ffmpeg -f x11grab -s 500x300 -r 25 -i :0.0 foo.mp4

The -s option tells ffmpeg the pixel size of the region you want to grab; -r is the frame rate, -i is your X screen, and the video is written to foo.mp4.

If you don’t want to start the screen capture in the top-left, just use something like -i :0.0+100,200 to specify where to start and the resolution to capture.

The ffmpeg website has more info.

Posted Tuesday, February 19, 2019

Blog contents