gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
989 stars 316 forks source link

Burst capture #968

Open davidedelvento opened 3 months ago

davidedelvento commented 3 months ago

Prologue

I am not sure if this is operator error, PTP limitation, or using the wrong tool for the job.

I have a number of different DSLR and mirrorless Nikon cameras which all can take extremely fast bursts with several shoots per second in either identical exposure or bracketing conditions.

It looks like whatever I do, with either gphoto2 CLI (from the latest Ubuntu's snap, which brings v2.5.15) or libgphoto2 (gotten from Pip's python-gphoto2, which brings libgphoto.so.6.3.0) I can never achieve more than 1 shot per second which is absolutely insufficient for my needs.

There is a large number of people with similar complaints spread out in time since the project started, so maybe this is not supported? For just two examples https://github.com/jim-easterbrook/python-gphoto2/issues/123 and https://github.com/gphoto/libgphoto2/issues/317 but there are many more maybe mentioning terms like slow or fast or bracketing etc.

Describe the bug

Is this something that is supposed to work or not? If yes, how? Just repeating the capture slows to a crawl and is totally inadequate. Maybe it works only with some protocols? Only with some cameras (obviously not expecting to go faster than the camera can go on its on)? To keep it simple let's say without downloading the images, just saving them on the SD cards (yes, these are indeed top-notch speed and work perfectly at the speed the camera is capable on -- when using it standalone rather than connected to the computer).

To avoid frustrating people, it would be greatly appreciated if there could be an authoritative section in the docs or README.md saying:

Thanks!!!

msmeissn commented 3 months ago

This is hard to specify, and I would say it is camera and hardware dependent.

Also a bit API challenge:

The original capture_image API waits until the image is fully available, which usually takes longer.

There is the trigger capture API and gphoto2 --trigger-capture command, which does not wait until the camera has the image ready, so can queue off more shots while the camera is processing the previous ones still.

So if you specify multiple --trigger-capture (or trigger capture api calls), you should get speeds higher than 1/second.

You will however only get the filename additions later on when the cameras has processed the images (and you can get them via wait-event).

For testing, I just did with my Nikon Z6:

gphoto2 --trigger-capture --trigger-capture --trigger-capture --trigger-capture --trigger-capture --trigger-capture --trigger-capture --trigger-capture --wait-event-and-download=20s

first shot - a 0.x second delay somehow - further shots with definitely less than a second distnace.

only after around 10 seconds it starts downloading images.

davidedelvento commented 3 months ago

Thank you @msmeissn this helps. I will try it today and report back with exact setup.

Yesterday I tried examples/sample-trigger-capture.c, even removing the wait_event_and_download was a far cry from what the cameras can do on their own.

You will however only get the filename additions later on when the cameras has processed the images (and you can get them via wait-event).

I suspect this is part of the problem. For this use case, I think one has to forgo the filenames and downloads and that is exactly what I am trying to do.

davidedelvento commented 3 months ago

With my Nikon D5500, D5300 and Z50, a single --trigger-capture gives an error but works. Using more than one trigger, only errors (of the PTP device is busy kind). So it seems that gphoto2 is able to put out the request, but it does so too fast for these cameras to parse, which is quite unfortunate (especially because they can parse equivalently fast or continuous pressure of their physical shutter button).

Thanks again

msmeissn commented 2 months ago

There is also on Nikon a "BurstNumber" setting, here for us "burstnumber" configuration.

if you set this, and either do capture_image or trigger_image it will ttake the burstnumber images as fast as the camera can.

seems aavailable on all Nikon D and Z

davidedelvento commented 2 months ago

Oh, fantastic!! Thanks so much for mentioning it! I confirm it works with my cameras. Perhaps it just needs some advertising... Speaking of which, is there a place where a list of all these settings are specified, hopefully with their syntax? Every time I try to change something differently from what I've done in the past it feels like I'm reverse engineering the camera....

As far as I am concerned, this issue can be closed.