I wanted to try some time-lapse photography using my shiny new HD camcorder, but it turns out it doesn’t seem possible using Mac OS X (boo!), so I turned my attention to the built-in iSight in my MacBook Pro instead. The image quality will be much lower, obviously, but I figured it’d be good fun to try until I figure a way to use my camera proper.
After trying and failing to write working AppleScripts and Automator workflows to take photos with the iSight and save them with sequential filenames, I came across iSightCapture, a command line utility that, with the correct parameters, would do the job I needed. Luckily, during the same search I also found the AppleScript I would need to make things easier from neoporcupine — his post goes into great detail on how to automate taking photos at regular intervals for security and other purposes, but I’m just aiming for a ‘click and go’ approach.
After downloading, unZIPping and copying iSightCapture to our desired location (I just put it in the main Applications folder), we need to amend the AppleScript we borrowed from neoporcupine, e.g:
repeat 3000 times
do shell script "/Applications/isightcapture ${HOME}/Pictures/Lapse/snap`date '+%y%m%d%H%M%S'`.jpg"
delay 5
end repeat
Going line-by-line we have:
- the number of photos to take, e.g. 3000;
- taking the photo and saving it — the above example saves it to ‘Pictures/Lapse’ in my home folder and adds the date and time in the format YYMMDDHHMMSS;
- the gap between photos, e.g. five seconds;
- the end of the loop.
(With the sequential naming of the file, I’m obviously not expecting to make sequences that last months or years, but if it was running at midnight on New Year’s Eve then obviously the day, month and year would change and the files need to be kept in sequence.)
Copy and paste that into Script Editor, change whatever values you need to make it fit your requirements and save it. You may want to test it at this point, too. If you’re just going to run this script straight from Script Editor (which is what I did) then you can skip the next parts and go straight to the bit involving QuickTime. Otherwise, read on …
To get your time-lapse sequence to start at a specified time automatically, e.g. to catch the sunrise while you’re still in the land of nod, then we need to set up a reminder in iCal — you can use alternative methods of course, such as Proxi, but iCal’s easy, simple and is already installed on all modern Macs. (The only problem with this method is that it can be difficult to stop a script once it’s running in the background as there’s big red STOP! button anywhere.) So, just create an event for the day and time you want the script to start and make sure you add an alarm to run the script itself at the time of your choosing, e.g.:

iCal time-lapse capture event
You can also set your Mac to wake up at the appropriate time if it’s running on battery or you simply don’t want it left on beforehand — just go into System Preferences -> Energy Save -> Schedule and make the appropriate changes:

Energy saver schedule settings
The next step is to position your Mac (which, in my experience, was a bit difficult unless you open up Photo Booth to get an idea of what the camera can see, but don’t forget to quit it when you’re done otherwise iSightCapture will fail) and then … wait.
It’s worth mentioning at this point that iSightCapture did occasionally fail for no apparent reason, reporting that the camera lens couldn’t be opened, which I’m assuming is a generic “I can’t get the camera working!” error message.
Once your capture is complete, you should hopefully have a folder full of photos, all nicely named in sequence, so if that was your goal then you’re done. If, like me however, you want to make them into a movie then read on …
Open QuickTime Player and select ‘Open Image Sequence…’ from the File menu, navigate to the folder where your photos are stored, select the first one and click ‘Open’. Select a frame rate (I chose ‘24 frames per second’) and QuickTime will make a movie of your photos.
You can save it now as is, but it’s uncompressed and, depending on the number of photos, may result in a very large file. I usually choose ‘Export…’ from the File menu, select ‘Movie to QuickTime Movie’ and ‘Default Settings’ which gives a reasonable quality output. You can then do whatever else you desire with the final file, such as editing together a few of them, adding some music and uploading it to YouTube:
If you find any of this useful and do actually make a movie, then please leave me a comment with a link. Cheers!
