iMovie is not enough when you want to create a movie from hundreds of snapshots. I’m not able to import them without transitions, so I switched back to what I knew, the Army Knife of video tools: FFMPEG.
Installing it on your Mac is easy with MacPorts, which is similar to apt-get in Ubuntu. Download and install MacPorts first, so you can invoke it from a command line in a terminal.
Fetching, compiling and installing ffmpeg will probably require more than half an hour, depending on your Internet connection, because it needs a lot of packages that are not installed by default in MacOS. But MacPorts works like a charm:
sudo port install ffmpeg
and wait. Do something interesting meanwhile, like reading a book, having a walk or petting your cat…
Once ffmpeg is in your system, navigate in a terminal to the folder where you stored your screenshots (like those we created with the Python script) and type this:
ffmpeg -r 10 -i img%06d.png -vcodec libx264 -vpre hq -bf 0 -crf 15 output_video.mp4
That will create an h.264 video using High Quality (-vpre hq, -crf 15) and a low frame rate (10 fps. Put that BEFORE -i, or it won’t work). B-Frames are removed (-bf 0), otherwise YouTube messes the whole thing. Image file names must be consecutive, just change their name if you used a different one.
And this is the result! Not exactly useful when talking about programming… but it still looks great.