libgphoto2(3) is a cross-platform digital camera library, and gphoto2(1) is a command-line client for it.
Where an option takes a RANGE of files, thumbnails, or other data, they are numbered beginning at 1. A
range is a comma-separated list of numbers or spans (“first-last”). Ranges are XOR (exclusive or), so
that “1-5,3,7” is equivalent to “1,2,4,5,7”.
--debug
Turn on debugging output. Debugging output is written to stderr by default, or to the filename given
to the --debug-logfile option.
--debug-logfileFILENAME (since 2.3.0)
The logfile to write the debugging info to, if --debug is given.
--debug-loglevelLEVEL (since 2.5.5)
The verbosity of debug logging. Possible values with incrementing verbosity are: error, debug, data,
all. Default is all.
--hook-scriptFILENAME (new after 2.3.0)
Execute the hook script FILENAME every time a certain event happens within gphoto2. The hook script
reads the environment variable ACTION. It must ignore ACTION values unknown to it.
ACTION=init
gphoto2 has just been initialized. If the hook script returns with a non-zero exit code now,
gphoto2 will abort.
ACTION=start
gphoto2 has just finished parsing the command line and is about to start executing the commands
given on the command line.
ACTION=download
gphoto2 has just downloaded a file to the computer, storing it in the file indicated by the
environment variable ARGUMENT.
ACTION=stop
gphoto2 is about to finish. Do your final cleanups here.
All other environment variables are passed to the hook script unchanged. You can make use of that to
pass data to the hook script.
Hook script may be specified in the ~/.gphoto/settings file as gphoto2=hook-script=filename.
-q, --quiet
Quiet output (default=verbose).
-v, --version
Display version and exit.
-h, --help
Display options and short description.
--usage
Display a short usage message.
--list-cameras
List supported camera models.
--list-ports
List supported port devices.
--stdout
Send file to stdout.
--stdout-size
Print filesize before data.
--parsable
Outputs the filelist in a line based format that could be passed into a shellscript or other filter.
--auto-detect
List auto-detected cameras and the ports to which they are connected.
--portPATH
Specify port device. The --list-ports prints a list of valid, usable ports. In case of multiple USB
cameras, the --auto-detect shows you the specific port each camera is connected to.
--speedSPEED
Specify serial transfer speed.
--cameraMODEL
Specify camera model. The --list-cameras option prints a list of all explicitly supported cameras.
Most model names contain spaces: remember to enclose the name in quotes so that the shell knows it is
one parameter. For example: --camera"KodakDC240".
Note that if you specify --camera, you must also specify --port. Otherwise the --camera option will
be silently ignored.
--filenameFILENAME
When downloading files from the camera, specify the file name or file name pattern to use when
storing the downloaded file on the local disk. When uploading a file to the camera, specify the
filename to store the uploaded file as on the camera.
The --filename option accepts %a, %A, %b, %B, %d, %H, %k, %I, %l, %j, %m, %M, %S, %y, %%, (see
date(1)) and, in addition, %n for the number, %C for the filename suffix, %f for the filename without
suffix, %F for the foldername, %: for the complete filename in lowercase.
Note that %: is still in alpha stage, and the actual character or syntax may still be changed. E.g.
it might be possible to use %#f and %#C for lower case versions, and %^f and %^C for upper case
versions.
%n is the only conversion specifier to accept a padding character and width: %03n will pad with zeros
to width 3 (e.g. print the number 7 as “007”). Leaving out the padding character (e.g. %3n) will use
an implementation specific default padding character which may or may not be suitable for use in file
names.
Default value for this option can be specified in the ~/.gphoto/settings file as
gphoto2=filename=value.
--filenumberFILENUMBER
If you specify the filename using the --filename option and use the %n pattern, this pattern usually
starts at 1. For incremental usage, you can use --filenumber to have it start at another number
FILENUMBER.
--usbidUSBIDS
(Expert only) Override USB IDs.
USBIDS must be of the form
DetectedVendorID:DetectedProductID=TreatAsVendorID:TreatAsProductID to treat any USB device
detected as DetectedVendorID:DetectedProductID as TreatAsVendorID:TreatAsProductID instead. All the
VendorIDs and ProductIDs should be hexadecimal numbers beginning in C notation, i.e. beginning with
'0x'.
Example: --usbid0x4a9:0x306b=0x4a9:0x306c-a, --abilities
Display the camera and driver abilities specified in the libgphoto2 driver. This all does not query
the camera, it uses data provided by the library. Use --summary to query an overview of the camera.
-f, --folderFOLDER
Specify camera folder (default="/").
-R, --recurse
Recursion (default for download).
--no-recurse
No recursion (default for deletion).
-l, --list-folders
List folders in folder.
-L, --list-files
List files in folder.
-m, --mkdirNAME
Create a directory.
-r, --rmdirNAME
Remove a directory.
-n, --num-files
Display number of files.
-p, --get-fileRANGE
Get files given in range.
-P, --get-all-files
Get all files from folder.
-t, --get-thumbnailRANGE
Get thumbnails given in range.
-T, --get-all-thumbnails
Get all thumbnails from folder.
--get-raw-dataRANGE
Get raw data given in range.
--get-all-raw-data
Get all raw data from folder.
--get-audio-dataRANGE
Get audio data given in range.
--get-all-audio-data
Get all audio data from folder.
--upload-metadataFILENAME
Upload meta data for the specific file, taken from a file prefix with meta_ .
--get-metadataRANGE
Get meta data given in range.
--get-all-metadata
Get all meta data from folder.
--force-overwrite
Overwrite files without asking.
--skip-existing
Skip files if they exist already on the local directory.
--new
Only get not already downloaded files. This option depends on camera support of flagging already
downloaded images and is not available for all drivers.
-d, --delete-fileRANGE
Delete files given in range.
-D, --delete-all-files
Delete all files in folder (defaults to --no-recurse).
-u, --upload-fileFILENAME
Upload a file to camera.
--capture-preview
Capture a quick preview.
-B--bulbSECONDS
Do a bulb capture for the specified amount of seconds.
--show-preview
Capture a quick preview and displays it in the terminal using Ascii Art (if aalib was used during
build).
-FCOUNT, --framesCOUNT
Number of frames to capture in one run. Default is infinite number of frames.
-ISECONDS, --intervalSECONDS
Time between capture of multiple frames.
(Since 2.4) If SIGUSR1 signal is received, a picture is taken immediately without waiting for the end
of the current interval period (see the section called “SIGNALS”). A value of -1 will let gphoto2
wait forever, i.e. until a signal arrives. See also --reset-interval.
--reset-interval
Setting this option will reset the time interval to the value given by the -I|--interval option when
a SIGUSR1 signal is received in time-lapse mode.
--capture-image
Capture an image and keep it on the camera.
--capture-image-and-download
Capture an image and download it immediately to the computer.
--trigger-capture
Triggers the capture an image and return. If you want to get the image downloaded, see
--wait-event-and-download.
This feature is only available for some camera brands and drivers.
--keep
When doing --capture-image-and-download or interval capture, this option will keep the images on the
memory card of the camera.
--no-keep
When doing --capture-image-and-download or interval capture, this option will not keep the images on
the memory card of the camera after downloading them during capture. (default)
--keep-raw
When doing --capture-image-and-download or interval capture, this option will keep the RAW images on
the memory card of the camera, but still download the JPEG images. This is useful when doing dual
mode capture and you want to review the JPEGs already during capture.
--capture-movieSECONDS
Capture a movie. If the camera supports previews, this will capture a stream of previews
(motion-jpeg) as fast as the camera can.
If not argument is specified, it will capture preview frames until you press Ctrl-C. Arguments that
can be specified are either seconds of capture or number of preview frames.
--capture-sound
Capture an audio clip. No driver supports this at this time.
--capture-tetheredSECONDS,MILLISECONDS,COUNTorMATCHSTRING
Lets gphoto2 wait for notifications from the camera that an object was added. This is useful for
tethered capture, where pressing the shutter on the camera immediately transfer the image to the
machine for processing.
Together with the --hook-script to immediately postprocess or display the images this can help a
studio workflow.
This option requires support in the driver and by the camera, currently newer Canon EOS and Nikon
DLSR work.
--wait-eventSECONDS,MILLISECONDS,COUNTorMATCHSTRING, --wait-event-and-downloadSECONDS,MILLISECONDS,COUNTorMATCHSTRING
Lets gphoto2 wait for notifications from the camera for various events. This is useful for seeing
what the camera does and waiting for objects to be added. The objects are kept on camera in the
“--wait-event” version, with “--wait-event-and-download” they are downloaded.
--wait-event-and-download is equivalent to --capture-tethered.
The time to wait can be either specified as full seconds with a "s" suffix, a number of milliseconds
with a "ms" suffix, as a number of events (just a number), or a sub-string to match. If nothing
happens, a timeout is generated after 1 second, so a “wait-event=5” will take at most 5 seconds. A
“--wait-event=5s” will take exactly 5 second.
It is also possible to wait for MATCHSTRING, for things like CAPTURECOMPLETE, FILEADDED, TIMEOUT or
other events printed out.
If no argument is given, the wait time is 1 million events (basically forever).
In the download variant this can be used together with the --hook-script to immediately postprocess
or display the images this can help a studio workflow.
This option requires support in the driver and by the camera.
If gphoto2 receives a SIGUSR1 during the wait, it will immediately take a picture (similar to
“--capture-image”), and depending on mode either leave it on camera or download it. (Since 2.5.28)
If gphoto2 receives a SIGUSR2 during the wait, it will safely end the tethering. (Since 2.5.25)
--show-infoRANGE
Show information for a single or multiple images, like width, height, size and/or the capture time
--config
Starts a ncurses based text configuration menu. gphoto2 needs to built against CDK for this feature.
--list-config
List all configuration entries.
--list-all-config
List all configuration entries and their values and choices.
This command is a combination of --list-config and calling --get-config on all the entries.
--get-configCONFIGENTRY
Get the specified configuration entry.
This command will list the type, the current value and also the available options of this
configuration value.
--set-configCONFIGENTRY=CONFIGVALUE
Set the specified configuration entry. For lists of choices of values this setting first looks up
CONFIGVALUE as value and then as index into the choice list. Since this is not fully clear, you can
use --set-config-index or --set-config-value to be more clear what is searched for.
Look at the output of --get-config to see what values are possible to set here.
--set-config-indexCONFIGENTRY=CONFIGINDEX
Set the specified configuration entry by specifying the index into the list of choices for the
configuration value. This of course only works for configuration settings that offer list of choices.
Look at the output of --get-config to see what indices are possible to set here.
--set-config-valueCONFIGENTRY=CONFIGVALUE
Set the specified configuration entry by specifying its new value. For lists of choices the value is
looked up and set.
Look at the output of --get-config to see what values are possible to set here.
--reset
Resets the specified (or autodetected) USB port.
This command resets the USB port of either the first auto-detected camera, or the port specified with
--portusb:XXX,YYY. This option is useful if somehow the protocol talking to the camera locked up and
simulates plugging out and in the camera.
--storage-info
Display information about the camera's storage media.
--summary
Summary of camera status.
--manual
Camera driver manual.
--about
About the camera driver.
--shell
Start the gphoto2 shell, an interactive environment. See SHELL MODEfor a detailed description.