Hardware Reference
In-Depth Information
Camera Protocols
gPhoto is not intended for controlling webcams, but there is one other reason your
camera might not be on the supported list. Most cameras with USB ports use either
(or both) Picture Transfer Protocol (PTP) or USB Mass Storage protocols. USB
Mass Storage doesn't allow remote control of a device and very much limits what
else you can do through the protocol and thus is fairly useless to us here. Many
modern cameras (post 2003) have used PTP as well. Nikon cameras often default
to USB Mass Storage, but you can switch them to PTP through the on-camera
settings menus.
In addition to your Raspberry Pi, your camera, and a USB cable to connect the two,
you'll need libgphoto2 , a libgphoto2 frontend (such as gphoto2 , gtkam , kamera , or digi
kam ) and libusb on your Pi. To get everything running on Pidora, run the following
command:
$ su -c 'yum install libgphoto2 gphoto2 libusb'
Here's how to get what you need on Raspbian:
$ su -c 'apt-get install libgphoto2-2 gphoto2 libusb'
If you'd like to see whether your camera is supported before trying this out, run
gphoto2 --list-cameras , but the list is quite long, and unless you have an odd or
new camera, it's almost certainly in there.
Now, let's test them! Plug your camera into your laptop via USB cable and enter:
$ gphoto2 --capture-image-and-download
You might get the following error:
*** Error ***
Out of Focus
ERROR: Could not capture image.
ERROR: Could not capture.
Fortunately, the error generally tells you where you went wrong. But preferably, you'll
capture a photo:
New file is in location /capt0000.jpg on the camera
Saving file as capt0000.jpg
Deleting file /capt0000.jpg on the camera
Deleting 'capt0000.jpg' from folder '/'...
You can even capture video this way by specifying the number of seconds you'd like
to record:
 
Search WWH ::




Custom Search