I thought it would be awesome to be able to look back and quickly see the evolution and development of my application for the Rails Rumble, so I wanted to figure out a good way to make a timelapse video of my work during the competition.

I’d love to see some other developers do this too, so if you record your progress and make a video, please let me know, and I’ll post a collection of the videos here after the rumble.

I’ll be taking a screenshot every minute, and supposing I work for 40 of the 48 hours and display each screenshot for 3 frames, the video will be about 4 minutes long. I’ll also be taking a picture of my increasingly tired face with my iSight.

I use a dual-screen setup, which is what caused most of the problems along the way. Here’s how I’m setting things up.

Timed Screenshots

I thought it would be pretty easy to write a little script that would take a screenshot every minute, but it turned out to be a bit harder than I expected to come up with a solution that I was happy with.

As it turns out, the native OSX ‘screencapture’ command is really slow, taking about 3-4 seconds to complete, and worse, it freezes the entire system for the whole time. Not such a good option.

After looking at a bunch of other options, I decided to use an application called InstantShot!, which supports taking timed shots. Instant shot has some good features, but it can only work on one screen at a time. To get around this, just open a new instance of the application (open -na InstantShot!) so you can use one on each screen.

InstantShot! Settings

If you set the preferences correctly, you won’t have to change anything except the active screen for one of the instances.

  1. Set your save path and filename (called prefix).
    If you are using 2 screens, you’ll want to save the screen index at the beginning so you can sort them out easily.
    Here is my prefix: :S_:M-:D-:Y@:h.:m.:s (paste by right clicking, the keyboard shortcut won’t work)
  2. Make sure you are capturing in .png format. Do this by selecting “Shoot with timer > To Png file…” and that setting will be used in the future.
  3. In “Advanced” select “Automatically start multiple shots” and use 10 seconds.

As far as I can tell, the only way to make it stop shooting is to quit.

It’s worth mentioning that your application preferences are saved to disk when you quit an application. If you want to make permanent modifications to preferences, make sure the instance that you quit last is the same one you used to change your settings or your changes will go unsaved. You can, however, change settings during an application’s life-cycle, and they will be in effect as long as you have that instance open.

Timed iSight pictures

The only way I could find to get pictures from the iSight is a command line tool called isightcapture. The original developer’s website is no longer around, but I found a copy of the script that you can download here.

Make sure to put the downloaded script in /usr/bin/.

Quick Setup

Here’s the script I’m going to run to get things going. All you have to do is change the active screen in one instance if InstantShot! and leave the script running until you want it to stop taking pictures with your camera. The script will output the time whenever it takes a picture.

system 'open -na InstantShot!'
system 'open -na InstantShot!'

puts "--- Change the active screen in one instance of InstantShot."

# InstantShot is set to start shooting after 10 seconds
sleep 10

loop do
  # Using a new thread for the picture keeps the timer accurate
  Thread.new do
    system 'isightcapture ~/Desktop/Rumble\ Screenshots/iSight/`date +%m-%d-%Y@%H.%M.%S.jpg`'
    puts Time.now.strftime('%H:%M:%S')
  sleep 60