Gphoto2

From LQWiki
Jump to navigation Jump to search

Use gphoto2 to get those files from your digital camera.

Install it

Install it by means of your distribution as described here e.g. for SUSE Linux open a console and enter

yast -i gphoto

Run it

Start like this:

mkdir camera
cd camera
gphoto2 --get-all-files

This will obviously get all files, pictures and videos, from your camera to your current directory. Very advanced users can go on like this:

gphoto2 --help
man gphoto2

TroubleShooting

Camera is locked

Symptom

When trying to access the digital camera you get an error message saying it is locked, like this one:

linux-qgla:~/cam # gphoto2 --get-all-files
                                                                               
*** Error ***              
An error occurred in the io-library ('Could not lock the device'): Camera is already in use.
*** Error (-60: 'Could not lock the device') ***       

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --get-all-files

Please make sure there is sufficient quoting around the arguments.

Solution

Find out what processes have the camera locked:

linux-qgla:~/cam # lsof | grep usb
usb-stora  527       root  cwd       DIR       8,17      4096          2 /
usb-stora  527       root  rtd       DIR       8,17      4096          2 /
usb-stora  527       root  txt   unknown                                 /proc/527/exe
hald      2400  haldaemon  mem       REG       8,17    357258    5673238 /usr/share/usb.ids
gvfsd-gph 5360       root  mem       REG       8,17     35420    5641079 /usr/lib/libusb-0.1.so.4.4.4
gvfsd-gph 5360       root  mem       REG       8,17     22008    5771692 /usr/lib/libgphoto2_port/0.8.0/usb.so
gvfsd-gph 5360       root    8r      CHR      189,5       0t0      16806 /dev/bus/usb/001/006

Kill the processes

linux-qgla:~/cam # kill 5360

And try again:

linux-qgla:~/cam # gphoto2 --get-all-files
Downloading '100_0001.MOV' from folder '/store_00010001/DCIM/100KM341'...      
Saving file as 100_0001.MOV                                                    
...

What comes then?

After you have downloaded your images from the camera, you may want to convert them to share them on http://www.facebook.com or so.

See also