Picture-in-picture timelapse of dual monitors

A few months ago, I wrote a post on how to do a picture-in-picture timelapse recording when dealing with a dual monitor setup where each monitor has its own separate X display.

Long story short, after a harddrive failure forcing me to reconfigure my linux setup, I went away from the dual X screen setup, to a single X display spanning the two montiors.

This means that a screen dump using xwd -root -out screenshot.xwd produces a single image of both monitors side-by-side. This also means the script I wrote for the previous post no longer works. A rewrite was in order to deal with the new setup, and that's what this post is for.

I'll keep this post short with only the script and a demo recording (a timelapse made while writing this post). For an explanation of the ImageMagic magic, see the previous post.

1. Script

Putting together the various pieces mentioned so far, this is the final script.

2. Demo

If the above script for some reason skips a frame, this will cause problems when creating a video from them. A quick fix is to create a symlink to the previous file, for any missing frame.

A 30 fps video, consuming 15 frames for each second in the output, can be made using ffmpeg with the following:

While I wrote this post, I had the screen recording script running, and this is the produced video: