↑ arvau

ArchWiki / GPhoto

es:GPhoto ja:GPhoto ru:GPhoto zh-hans:GPhoto Libgphoto2 is the core library designed to allow access to digital cameras by external (front-end) programs, such as digiKam and gPhoto2. List of officially supported cameras is available on the official website (though more may work).

This article documents the configuration of libgphoto2 to access digital cameras. Some digital cameras will mount as normal USB storage devices and may not require the use of libgphoto2.

Installation

Install the libgphoto2 package, and optionally gphoto2 to have a command line interface.

Mount

Frontend applications

GPhoto2 usage

GPhoto2 is a command line client for libgphoto2. GPhoto2 allows access to the libgphoto2 library from a terminal or from a script shell to perform any camera operation that can be done. This is the main user interface.

GPhoto2 also provides convenient debugging features for camera driver developers.

Quick Commands

  • gphoto2 --list-ports

  • gphoto2 --auto-detect

  • gphoto2 --abilities

  • gphoto2 --summary

  • gphoto2 --list-files

  • gphoto2 --get-all-files

  • gphoto2 --capture-image-and-download

  • gphoto2 --set-config datetime=now - sets the camera to the current time

For advanced file manipulation, use

  • gphoto2 --shell

With gphoto2 --capture-movie it is possible to use supported cameras as a webcam. See v4l2loopback#Using a photo camera as webcam with gPhoto for details.

Example usage with GVfs

Auto detect the connected camera and list the required port:

----------------------------------------------------------
Canon Digital IXUS 980 IS      usb:006,011
$ gphoto2 --auto-detect

Now open your favorite file manager and enter the address with the found port detail gphoto2://[usb:006,011]. File manager functionality#Mounting will use gvfs to get the camera mounted and manageable with the file manager.

Troubleshooting

Permission issues

Users with a local session have permissions granted for cameras using ACLs. See General troubleshooting#Session permissions if it does not work.

Claimed device

Your system might automatically mount the camera as a file system and then some gphoto2 commands output the error message "cannot claim device". In this case unmount the camera using your file browser or run:

$ gio mount -s gphoto2