Archiving Screencast Videos

Because my computer is a bit old (Ivy Bridge i7-3770), it can only do 1440p screen capture at 60fps when using the -preset ultrafast setting in OBS Studio.

For a processor built in 2012, this is actually pretty good.

When I’m doing a screencast, I want the bulk of the CPU cycles to go towards the program running, not the video encoding. I don’t have a discrete graphics card, and I’m using a small form factor desktop anyways, so my options are limited and price / performance will suck with a 75 watt single-slot PCIe power budget.

Later, I go through and transcode the files into archival format. The above command tells the encoder (by default, libx264) to use a Constant Rate Factor of 0 (lossless) and -preset veryslow to squeeze as much data out of the file as possible, trading CPU time and computational complexity for storage.

For example, here’s a list of files and sizes associated with an archival codec and an editing codec.

You can see that the archival format can be ~4x – 10x smaller than the original files, particularly in cases where there isn’t a lot of motion, or large amounts of low-entropy data (i.e. screencasts where the background is a solid color).

If I later want to use the video as source material in my editor, I transcode it back to a low-res, low-complexity proxy file. I’d want to do that anyway since my computer would otherwise become a hiccuping mess when applying filters to 1440p or 2160p source videos.

Both sets of files above were created using Shrinkr, but in the future I will use an SCons build file to generate the archival files.

The general command is:

ffmpeg -benchmark -i input.mkv -crf 0 -preset veryslow -c:a copy -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mkv

Funnily enough, even though it’s considered lossless, when I run the files through the Netflix VMAF test, it will not identify them as identical. But they should be computationally the same and visually indistinguishable (both using -crf 0, at a fraction of the space.

VMAF score: 97.430436 for two files

The writer of the seminal streaming codec shootout “NVENC comparison to x264 x265 QuickSync VP9 and AV1 (unrealaussies.com)” makes the good point that VMAF is a bit fuzzy and will return less than a 100% match for identical files. But that this matches the fact that a real human probably wouldn’t be able to see this visually either.

I’m still getting up to speed on video editing, but already learning some of the tricks that help make it an enjoyable experience.