Saturday, September 13, 2014

The foolproof way to do screen capture

Years ago, i did my first screen capture experiment. I put together an ugly pair of scripts to take screenshots at infrequent intervals, capturing the essence of a slow and boring bit of work in GIMP. I surmised at the time that there are probably lots of better ways.

Fast forward to recent months. I was trying to demonstrate the use of Matlab to encode images and text into audio spectra. I needed more typical framerates and i wanted companion audio, so i figured that it was the time to search for that "better way". In Mint 14, i had a lot of options suggested by forums and by software sources:
  • Istanbul -- Ogg video desktop recorder 
  • RecordMyDesktop -- Another desktop recorder 
  • Kazam -- Yet another 
  • VLC -- has a mode for capturing the desktop 
Unfortunately, none of these programs actually worked properly. Kazam crashes and often produces corrupted output. Istanbul produces choppy output if it actually saves anything at all. RMD and VLC are similarly broken on my system. IIRC, parts of the bugginess comes from particular ogg or python library versions, and perhaps things work differently on a more up-to-date system. I don't care. They're broken on mine.

Since none of these tools capture audio correctly anyway, i cut my losses and decided to capture video only.
ffmpeg -f x11grab -r 25 -s 1280x1024 -i :0.0 -sameq bullshit.mp4
... of course, you can do it with avconv instead of ffmpeg:
avconv -f x11grab -r 25 -s 1280x1024 -i :0.0 -same_quant bullshit.mp4
It's simple, it works, and it's faster and more flexible than some of the other options.

No comments:

Post a Comment