Thursday, February 21, 2008

Tethered capture with gphoto2

It turns out that it's fairly easy to use a linux box to
take pictures using my Nikon D50 and display the results
to the screen:

$ gphoto2 --capture-image --interval 10 -F 2 --hook-script

The above takes two frames ten seconds apart (making a D50 into
a very expensive webcam). Alternatively, I could use the following
to use the camera normally but have the pictures show up on the
computer screen:

$ gphoto2 --capture-tethered --hook-script

The "hook script" is what does the actual display after each shot:

$ cat
#! /bin/bash

self=`basename $0`

case "$ACTION" in
echo "$self: INIT"
# exit 1 # non-null exit to make gphoto2 call fail
echo "$self: START"
echo "$self: DOWNLOAD to $ARGUMENT"
eog ${ARGUMENT} &
echo "$self: STOP"
echo "$self: Unknown action: $ACTION"

exit 0

Pretty darn cool!

No comments:

Post a Comment


Label Cloud