For an upcoming project, we want to capture high resolution digital still images onto a computer from a camera. This is a technique used quite often in stop motion animation. A digital still camera is a very inexpensive way to capture images that are many, many times higher resolution than the HD video they will eventually be a part of. A simple method would be to capture a large amount of images onto a camera’s storage card, download them, and them import and compose them in a compositing program such as After Effects.
However, for this project, we need the image capture to be triggered not by the button on the camera, but by the computer the camera is connected to. I initially looked at both FrameTheif and iStopMotion because they support digital still cameras and have an applescript library. However, both have spotty support for remote capture and would want to grab onto any other cameras connected to the system (such as a dv cam). Eventually, I found the gphoto project on sourceforge.
Gphoto is an offshoot of an earlier project and is intended for linux users who want a way to download images from their camera to their computer. Evidently, there isn’t or hasn’t always been a standard for this kind of thing. Most cameras today use the ptp protocol to transfer images, but my research indicates that support for all but the most basic features of the ptp protocol are horribly broken on many cameras. Canon cameras have their own protocol that many of the people working on the gphoto project have reverse engineered. Thankfully, the 10D, which I’m using, is old enough to have some support. Oddly enough, the Canon supplied remote capture application doesn’t work in OS X 10.4.
An OS X version of gphoto can be found in DarwinPorts. The version on the project page does not, though there is some talk on the gphoto-devel list that it could sort-of work. While I was looking into this, I got some help from Paweł Szczęsny who posted about gphoto2 on OSX on his Night Photography Blog.
Using gphoto, I can capture using the –capture-image command. However, the command times out after the shot is taken. I think it is supposed to download the image or at least stop, but it does not seem to do anything. Using a small shell script wrapper, the capture can be triggered, communication with the camera aborted, and the new image downloaded from the card. I’ve posted my hack of a script below:
#!/bin/sh
gphoto2 --capture-image --quiet &
JOBNUM=`ps auxww | grep gphoto | grep -v grep | awk '{print $2}'`
sleep 8
kill $JOBNUM
sleep 2
gphoto2 -P --new
exit 0
Clearly, the shell script is horrible kludge. It won’t deal with any kind of errors at all. I am triggering it under very controlled circumstances, so it will work fine for my purposes.
In a future entry, I’ll talk about how I’m using this and what other applications glue it all together.
Get Walker Reader in your inbox. Sign up to receive first word about our original videos, commissioned essays, curatorial perspectives, and artist interviews.