gphoto / gphoto2

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

Setting ISO and aperture from CLI? #491

Open TheChymera opened 2 years ago

TheChymera commented 2 years ago

I have been using gphoto2 for a very long time to record via my SLR, but when recording I can't control the ISO and aperture via the camera controls.

Is there any way to do this via command line? If so, are there any command examples? man gphoto2 says nothing about either ISO or aperture :(

gentilmente commented 2 years ago

You could use --list-config and --setconfig *** list, to see how is named in your model and set, for setting a value.

TheChymera commented 2 years ago

@gentilmente thank you :)

I have tried this, but it doesn't quite seem to work:

  1. Is there any way to get this to work while I have e.g. gphoto2 --stdout --capture-sound --capture-movie running? as it stands that gives me an error (*** Error (-53: 'Could not claim the USB device') ***). I assume this is to be expected and can be worked around, but setting the settings without a live preview is of course a bit of a journey.

  2. More seriously, though. This doesn't seem to take effect:

chymera@decohost ~ $ gphoto2 --set-config /main/imgsettings/iso=20000
chymera@decohost ~ $ gphoto2 --get-config /main/imgsettings/iso
Label: ISO Speed
Readonly: 0
Type: RADIO
Current: 20000
Choice: 0 50
Choice: 1 64
Choice: 2 80
Choice: 3 100
Choice: 4 125
Choice: 5 160
Choice: 6 200
Choice: 7 250
Choice: 8 320
Choice: 9 400
Choice: 10 500
Choice: 11 640
Choice: 12 800
Choice: 13 1000
Choice: 14 1250
Choice: 15 1600
Choice: 16 2000
Choice: 17 2500
Choice: 18 3200
Choice: 19 4000
Choice: 20 5000
Choice: 21 6400
Choice: 22 8000
Choice: 23 10000
Choice: 24 12800
Choice: 25 16000
Choice: 26 20000
Choice: 27 25600
Choice: 28 51200
END

This much looks good, but when I start the preview again (gphoto2 --stdout --capture-sound --capture-movie) I see no difference. Running the preview with the --set-config argument (gphoto2 --set-config /main/imgsettings/iso=20000 --stdout --capture-sound --capture-movie) also does not seem to change anything. Setting it via the first identifier (gphoto2 --set-config /main/imgsettings/iso=26) seems to effect the same thing in the config reporting, but also does not influence the preview.

msmeissn commented 2 years ago

during a running "movie" / preview capture loop it is not possible with the commandline tool currently. (it would mean having some form of side channel / back channel).

also note that the liveview (which is used by movie capture) might not be influenced by these parameters.

also note that --capture-sound is not implemented for any camera at the moment

TheChymera commented 2 years ago

@msmeissn thank you for the information.

Is there no way to change the ISO/aperture for video capture then?

Omgitskillah commented 1 year ago

Hello @TheChymera , did you ever find a way around this? I find myself in the same situation as you and I haven't yet found a solution on any forums

TheChymera commented 1 year ago

I was able to put together a parameterized script to adjust the camera to low-light and bright-light conditions. Works moderately well, though it is pretty inconvenient that the camera needs to be turned off for that.

Is there perhaps a way to just set the exposure and let the camera adjust some particular setting for that? Like ISO or shutter speed?

Here's the script in case you're curious https://github.com/TheChymera/quickdigitalcamera/blob/master/bin/quickdigitalcamera_adjust