OSX Timelapse

Posted by
August 20th, 2010 2:05 pm

I haven’t been able to find a timelapse tool that works on OSX yet (Chronolapse runs, but doesn’t seem to start grabbing screencaps?), but as it turns out, it’s very easy to write a script to do this:

while true ; do sleep 60 && echo `date`‘ Capturing screenshot…’ && screencapture -C -m -t jpg -x -f cap.`date +%s`.jpg ; done

I’ve put the script here in my LD project on github: http://github.com/newobj/ludumdare/blob/master/tools/osx-screencap.sh

Just run this guy and you will start getting cap.*.jpg files in the current directory every 60 seconds. They’ll sort chronologically, which is necessary for compiling them into a movie.

When you’re done and have your mountain of JPG’s, you can use Time Lapse Assembler to turn them into a movie (it will also scale them down!)

If anyone knows of a better solution than this for OSX, please enlighten me. :)

8 Responses to “OSX Timelapse”

  1. deep9x says:

    I’m going to use Gawker (http://gawker.sourceforge.net/Gawker.html), which is pretty simple, and my testing has shown that it works pretty well. The only issue is that to run it on both my screens, I need to run two instances of it. I’ll probably be working one-screen for most of the time, though, so it’s not a major issue.

    • newobj says:

      yeah, i haven’t figured out how to get screencapture to capture both monitors etiher. i mean, it has an option to NOT capture both monitors, so i figured it would capture both by default, but no. It’d be interesting anyway because one monitor is 1440×900 and the other is 1024×768.

      • lazyking says:

        You can make it do two different images by giving it two filenames, like so:

        screencapture -x -C ~/timelapse/timestamp_screen1.png ~/timelapse/timestamp_screen2.png

        It makes two different images though. I’m working on trying to figure this out for myself and stumbled on this thread. Glad I did because that Time Lapse Assembler program looks promising (I was going to try to figure out a way to use ffmpeg.) I am thinking of possibly ImageMagick to assemble the two screenshots per timestamp into one before creating the movie. I’m planning to use a chron job for actually executing the script, but I didn’t know you couldn’t set a interval of less than a minute. More research for me! :)

  2. moop says:

    I found this tutorial a month or so ago. Sounds like it’s along very similar lines though. I guess there’s no all in one app for it yet so everyone’s throwing together shell scripts for it.


  3. melior says:

    Looks like a job for a cron …uh… job:

    *0 * 20-22 8 * /usr/bin/screencapture -C -m -t jpg -x -f cap.`date +%s`.jpg

    The cron daemon would run this every time:
    – the minute matches *0 (every ten minutes)
    – the hour matches * (every hour)
    – the day matches 20-22 (today through Sunday)
    – the month matches 8 (August)
    – the day of week matches * (we already took care of this above, but you could have put 0,5-6 [Sunday, Friday, Saturday])

    This way no open terminal is required, but you have to remember to get rid of it afterwards you’ll get a surprise one year from now.

    • newobj says:

      good point. although your min resolution is 1 minute. also, where does it put the files when run that way?

      • melior says:

        Hmm, the Arch Linux wiki has that *0 for every ten minutes, though I guess */10 works just as well. Of course the cron format might be a bit different for OS X. And yeah, you should probably specify where to put the pics. Could be something like this:

        echo “*0 * 20-22 8 * /usr/bin/screencapture -C -m -t jpg -x -f ~/screencaps/cap.`date +%s`.jpg” > ~/takescreencap.cronjob
        crontab ~/takescreencap.cronjob

        To make sure it’s running:

        crontab -l

        To stop it:

        crontab -r

  4. dRxL says:

    Hi I’ve made a shell script that both continuously captures OS X screen(s) at preset intervals and combines these images into an mp4 movie file.

    You can read more about it on my blog here:

    best regards

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]