gphoto / gphoto2

The gphoto2 commandline tool for accessing and controlling digital cameras.
GNU General Public License v2.0
717 stars 116 forks source link

filename issue with: gphoto2 --capture-image-and-download #328

Open jacksnodgrass opened 4 years ago

jacksnodgrass commented 4 years ago

Describe the bug I am not sure if this is a BUG or a As Designed Feature that I disagree with... maybe related to SONY cameras...

gphoto2 --capture-image-and-download by default does: New file is in location /capt0000.jpg on the camera

You can pass arguments to give it a name.. but the DEFAULT, no argument name is capt0000.jpg Each time I run: gphoto2 --capture-image-and-download` I have to decide if I want to keep the file and rename it to something else or I just have to come up with a string to pass the --filename argument to timestamp the photo. That seems overly cumbersome. I'd expect it to use capt0000.jpg then capt0001.jpg the capt0002.jpg. instead of capt0000.jpp each time.

I read that 'SONY' cameras can't see the contents on the SD card when gphoto2 access it as a remote device.. so maybe ghphoto2 only does this ( reusing capt0000.jpg ) each time because it can't see that that already exists. I only have the one Sony camera to test with.

Name the camera Sonny RX100 IV Sony DSC-RX100M4 usb:001,022

libgphoto2 and gphoto2 version

gphoto2         2.5.23         gcc, popt(m), exif, no cdk, no aa, jpeg, readline
libgphoto2      2.5.24         standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial lockdev locking

To Reproduce run the command: gphoto2 --capture-image-and-download` two times.. the 2nd time it will use the same /capt0000.jpg file and ask to overwrite it.

msmeissn commented 4 years ago

This is a result of SDRAM capture, where we immediately download the picture.

We need to synthesize a filename for it, as the camera does not give it one ... so in an instance of libgphoto2 we generate capt.jpg and count up from 0.

jacksnodgrass commented 4 years ago

I can put: gphoto2=filename=%Y%m%d%H%M%S.jpg into ~/.gphoto/settings and as long as it takes a second or more to capture an image... this will name my images as:

20200524075602.jpg
20200524075642.jpg
20200524075649.jpg
20200524075716.jpg
20200524075812.jpg

but NOT having to do that for a 'sony' ( and possibly others ) camera would be nice.

should I close this issues... I am not sure what the protocol is exactly.

marcuslechner commented 1 year ago

works for me with my Sony ZV-E10, thank you