Gphoto2
Gphoto Usage
Gphoto2 has several options for capturing and downloading images from these cameras. There is a command line interface, and a python library as a wrapper.
From the command line interface, the user can call --capture-image to trigger an image capture not not download it, and --capture-image-and-download to capture an image and download it from the camera onto the computer, however the download process takes around two seconds before the next image can be taken, as the camera stores the image on the SD card first. The a5100 has the option of liveview image download through --capture-preview, which instantly captures and downloads a 720p image.
The python library, called python-gphoto2, wraps most of the functions of the command line interface and allows better control of the camera in code. The best way to capture images using the python wrapper is to trigger capture using trigger_capture
, and download it directly from the camera, bypassing the SD card, using the wait_for_event
function, which waits for an event (such as a new image file appearing in the camera). See this example, and add a trigger_capture
call before the wait_for_event
call. A more refined version is implemented in flightsoftware, which waits until 0.5 seconds after the previous image capture to trigger the next capture, to keep the image capture interval more consistent.
Last updated