Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Capture Image without Autofocus #161

Open
kohlerdominik opened this issue Sep 4, 2018 · 21 comments
Open

[cli] Capture Image without Autofocus #161

kohlerdominik opened this issue Sep 4, 2018 · 21 comments
Assignees
Labels
Canon tagging canon reports Nikon tagging Nikon reports

Comments

@kohlerdominik
Copy link

kohlerdominik commented Sep 4, 2018

This is maybe more like question than an issue:

Is it possible to "capture-image-and-download" without triggering AF first. I think, capture-preview does somethink like this, altough, i'm not really sure what's exactly the difference between these two.

If there's no possibility for this, i would love if this can be added.

Controller: Raspberry Pi 3
Camera: Canon 4000D

@msmeissn msmeissn self-assigned this Sep 6, 2018
@msmeissn
Copy link
Contributor

msmeissn commented Sep 6, 2018

capture-preview just takes the liveview viewfinder.

you probably can do something similar to

gphoto2 --set-config eosremoterelease=Immediate --set-config eosremoterelease="Release Full" --wait-event-and-download=5s

this controls the shutter directly and bypasses the half-press focusing state

@kohlerdominik
Copy link
Author

kohlerdominik commented Sep 9, 2018

Thanks very much for this valuable input, it helped me a lot to develop the solution. I'd like to provide some feedback. Please notice, this answer is Canon specific!

i solved it like:

gphoto2 \
        --set-config eosremoterelease="Immediate" \
        --set-config eosremoterelease="Release Full" \
        --wait-event-and-download=ObjectRemoved

At least on the 4000D, when the image is sucessfully downloaded, it sends the "ObjectRemoved" Event, which then identicates to end the command. This allows long and short exposure times without unnecessary long waiting time.

For other people who also need to separate autofocus from the capturing process, this might be helpfull as well. It allows to use of contrast autofocus from live view to specify a specific spot in the image (in the example the center of the image, but make sure this coordinates are working for your model as well) and then try to focus on it. Badly, i have not found any event which tells the success or not, so it's necessary to control the image manually after sending this command.

gphoto2 \
        --set-config viewfinder=1 \
        --wait-event=1s \
        --set-config eoszoomposition=2075,1375 \
        --set-config autofocusdrive=1 \
        --wait-event=10s

@ai2ys
Copy link

ai2ys commented Jan 2, 2020

Does someone know how to capture without prior autofocus on a Nikon D80.

I am using the --trigger-capture command because I want to take several images as fast as possible one after another with different aperture values. I already tried setting the autofocusdrive=0, but the autofocus was still performed.
Ideally I would like to use one command, to perform AF and AE, then use these settings for all subsequent capture commands with different aperture values.
Does someone know how to solve this?

@kohlerdominik
Copy link
Author

kohlerdominik commented Jan 3, 2020

Altough i'm Nikon Photographer, I use gphoto only for Canon. But i think i remember Nikon having more settings available for this matter. Try gphoto2 --list-all-config and look for autofocus relevant settings. you might be able to disable it temporary like

gphoto2 \
        --set-config <some config to disable af> \
        --capture-image-and-download \
        --set-config <some config to reenable af>

About your HDR-capture:

You could try to use the "exposure compensation" setting. there you can over- and undercompensate for +3/-3 exposure levels. The camera compensates depending on the selected mode (e.g. if you use Aperture Priority (Mode A), it increases and reduces the exposure time accordingly to the measured brightness and your compensation).

This function is also available as automatic feature called bracketing and supported out of the box by Nikon cameras for many years now. My D800 from 2012 supports this. You might get used a D5000 for less than 100€ supporting it. It might be easier than doing manual setting changes. Depending on the Model, however, different sets of customization and amount of pictures might be possible, so check if the functionality you need is available on the model you'd like to buy.

@ai2ys
Copy link

ai2ys commented Jan 4, 2020

I already tried config settings for disabling the AF, but it did not work out, the camera always does the AF drive prior to the capturing process.

gphoto2 --set-config autofocus=Off --trigger-capture

Bracketing would only be an option if Aperture Bracketing would be available, because I need different aperture values. As far as I know the Nikon D80 does support Aperture Bracketing.

Any other suggestions?

@msmeissn msmeissn added the Nikon tagging Nikon reports label Jan 5, 2020
@msmeissn
Copy link
Contributor

msmeissn commented Jan 5, 2020

can you check if the setting has stuck?

gphoto2 --get-config autofocus

should show it to be off.

If yes, can you capture a debug trace of this?

@ai2ys
Copy link

ai2ys commented Jan 12, 2020

Capturing without prior AF drive (Nikon D80). I found out how to solve this problem.

$ gphoto2 --set-config controlmode=1 #1: PC mode, 0: camera mode
$ gphoto2 --set-config focusmode2="MF (selection)" # not able to to this when not in control mode = 1
$ gphoto2 --set-config f-number=f/2.8 --trigger-capture
$ gphoto2 --set-config f-number=f/8 --trigger-capture
$ gphoto2 --set-config focusmode2="AF-S"
$ gphoto2 --set-config controlmode=0

Setting gphoto2 --set-config autofocus=Off had no effect, although the value was "Off" when checking afterwards with gphoto2 --get-config autofocus.

@msmeissn msmeissn added the Canon tagging canon reports label Jan 13, 2020
@thomasst1012
Copy link

I am lookin for a Solution for my Canon EOS 1200D - nothing works to Disable the AF.
The Camera is mounted on a High Roof, so i cant easily change it manuelly to MF.
Id Like to set the Focus once and keep it. But everytime i Take a Picture it will set a new focus :(.
What doing i wrong.
Sorry, for my bad english :(

So i call the Camera to take a Picture:

gphoto2 --set-config autofocusdrive=0 \
        --set-config eosremoterelease=5 \
        --wait-event=5s \
        --set-config eosremoterelease=4 \
        --capture-image-and-download \
        --filename "webcam.jpg" \
        --capture-tethered=70

So i set the Focus once:

gphoto2 --set-config viewfinder=1 \
        --wait-event=5s \
        --set-config eoszoomposition=5050,2109 \
        --set-config autofocusdrive=1 \
        --wait-event=10s \        
        --capture-image-and-download  \
      --filename "test.jpg"

Thank you for your Help.
IMG_2948

@simontorres
Copy link

@thomasst1012 can't you turn off autofocus from the lens?

nice picture by the way, it reminds me of Innsbruck where I lived one semester, shouldn't be so far :D

@thomasst1012
Copy link

@thomasst1012 can't you turn off autofocus from the lens?

nice picture by the way, it reminds me of Innsbruck where I lived one semester, shouldn't be so far :D

@simontorres - thats not so easy, the picture is from the installation last year.
And i think it is maybe helpful to set a new Focus remote.

Thank You :) - it's not far away from Innsbruck - it´s in Vorarlberg, Montafon, Bartholomäberg. ;)

@kohlerdominik
Copy link
Author

Hi @thomasst1012

i think your issue is, that you use --capture-image-and-download which will always trigger autofocus. try my solution from above.

@thomasst1012
Copy link

Hi @thomasst1012

i think your issue is, that you use --capture-image-and-download which will always trigger autofocus. try my solution from above.

Hei @kohlerdominik

I think I solved it that way:

gphoto2 \
        --set-config eosremoterelease=5 \
        --set-config eosremoterelease=4 \
        --capture-image-and-download \
        --filename "webcam.jpg" \
        --capture-tethered=70

I was confused by this error message:

FEHLER: Konnte Bild nicht aufnehmen.
Warte auf 70 Ereignisse von der Kamera. Drücke Ctrl-C zum abbrechen.
Speichere Datei als webcam.jpg
CAPTURECOMPLETE
UNKNOWN PTP Property d102 changed
UNKNOWN PTP Property d101 changed

Despite the error message, the picture is taken.

I'll watch it now and report to you tomorrow.

Thank You

@msmeissn
Copy link
Contributor

usually you do not need to mix eosremoterelease and captureimage.

eosremoterelease is basically same as pressing the shutter (half / full / releasing... depending on number), a following capture-tethered or wait-ervent-and-download will download its image.

I see that with eosremoterelease=5 should be "Immediate" and eosremoterelease should be "Release Full"

If this does not work, check if you set "focusmode" to Manual after autofocusing once.

msmeissn added a commit to gphoto/libgphoto2 that referenced this issue Apr 29, 2020
@msmeissn
Copy link
Contributor

On Nikon...

On the D80 the selectioon via "autofocus" was not yet working correctly.

I have now changed the code to also honor the "autofocus" property in current libgphoto2 git master.

@thomasst1012
Copy link

@msmeissn
When i change capture-image-and-download to wait-event-and-download the AF is still refocusing.

gphoto2 \
        --set-config eosremoterelease=5 \
        --set-config eosremoterelease=4 \
        --wait-event-and-download=5s \
        --filename "test.jpg"

When i change focusmode (set-config autofocusmode=0) the camera is also still refocusing.

With eosremoterelease & capture-image-and-download it works.

Addendum to yesterday:

Yesterday in the Evening the Camera has stopped making pictures. I think it was a trouble with the exponsure time. After a few hours of try i fixed it (added --capture-tethered):

gphoto2 \
         --set-config eosremoterelease=5 \
         --set-config eosremoterelease=4 \
         --capture-image-and-download --capture-tethered=70 \
         --filename "webcam.jpg" 

@msmeissn
Copy link
Contributor

I wrote "focusmode".

3 different things to check / try:

  1. What does gphoto2 --get-config focusmode report?

  2. Can you try other eosremoterelease options... I think these are the ones without autofocus.

gphoto2 --set-config eosremoterelease=8 --set-config eosremoterelease=7 --wait-event-and-download=5s

  1. I think you might need to inject a --wait-event=200ms between the eosremoterelease calls. UIf you press the vshutter and release it too fast in "low light" conditions, it will not have time to take a picture.

@thomasst1012
Copy link

I have tried this with multiple eosremorelease options, it always triggers the Autofocus.

The Result:

gphoto2 --get-config focusmode
Label: Fokusmodus
Readonly: 0
Type: RADIO
Current: AI Fokus
Choice: 0 Einzel AF
Choice: 1 AI Fokus
Choice: 2 AI Servo
END

@sakibnaz
Copy link

Hi. Is it possible to trigger only Auto-Focus without Capture-Image.

I tried this below, but did not work.

gphoto2 --set-config eosremoterelease="Press Half" --wait-event=5s --set-config eosremoterelease="Release Half"

Thanks.

@kohlerdominik
Copy link
Author

Hi @sakibnaz

did you try my solution from above?

@sakibnaz
Copy link

Hi @kohlerdominik .. I see, great. I missed that. Just tried and its exactly what I am looking for.

gphoto2 --set-config autofocusdrive=1 --wait-event=5s

I tried only autofocusdrive=1 before and did not work. So the clue is need to use wait-event.

This autofocusdrive should be a global command for Canon and Nikon ... right?

Also one more ques ... in manualfocus drive ... what is the step difference between Near and Far? Like, how many "Near 1" equals to 1 "Near 2" and 1 "Near 3" .. same for Far. Is there any relation calculation? Actually, I wanted to do Timelaspe Focus Ramping.

Thanks.

@vepicurean
Copy link

vepicurean commented Aug 29, 2021

Thanks very much for this valuable input, it helped me a lot to develop the solution. I'd like to provide some feedback. Please notice, this answer is Canon specific!

i solved it like:

gphoto2 \
        --set-config eosremoterelease="Immediate" \
        --set-config eosremoterelease="Release Full" \
        --wait-event-and-download=ObjectRemoved

At least on the 4000D, when the image is sucessfully downloaded, it sends the "ObjectRemoved" Event, which then identicates to end the command. This allows long and short exposure times without unnecessary long waiting time.

For other people who also need to separate autofocus from the capturing process, this might be helpfull as well. It allows to use of contrast autofocus from live view to specify a specific spot in the image (in the example the center of the image, but make sure this coordinates are working for your model as well) and then try to focus on it. Badly, i have not found any event which tells the success or not, so it's necessary to control the image manually after sending this command.

gphoto2 \
        --set-config viewfinder=1 \
        --wait-event=1s \
        --set-config eoszoomposition=2075,1375 \
        --set-config autofocusdrive=1 \
        --wait-event=10s

I know this is an old thread, but this is exactly the issue that I'm running into. I don't need the camera/lens autofocusing on every capture with --capture-image-and-download --interval -1 and using the -SIGUSR1 signal to trigger the capture process.

Right now I have to set the physical switch on the lens to "AF", otherwise --capture-image-and-download will freeze the camera and everything goes haywire with gphoto2 and the entire capture sessions fails.

Once I focus the camera/lens with the exposure settings I want, I want everything locked (exposure settings and the focus point locked) until I want them changed.

Note: Shutter speed is always 1/200s, IS0 is always 100, I only change the aperture slightly depending on environmental conditions...... I manually focus the lens/camera with a half press of the shutter targeted at the capture target. Then I want all the exposure settings and also the lens focus locked under --capture-image-and-download --interval -1 - until I need to change the aperture and/or re-focus the lens again (because I physically changed something, such as cleaning the lens, moving the camera, different target, etc.), but I will always do that lens re-focus and lockdown step myself.

What settings/parameters via gphoto2 would accomplished this goal on a Canon EOS 5DS R using --capture-image-and-download --interval -1 using a kill -SIGUSR1 PIDXXX signal to remotely trigger the --capture-image-and-download every 2 to 3 seconds via USB3?

Note: I'm not even sure --capture-image-and-download is fast enough with RAW image files to operate consistently at this 2 to 3 second remote trigger/shutter release interval. I find --capture-tethered was much faster in terms of execution, but I can't figure out a way to use --capture-tethered without an external remote trigger cable, which we are hoping to avoid.

Right now the lens/camera "focusmode" are set to "One Shot", which when I'm able to lock the focus (set the lens to MF) works very well for us with our high performance flashes. But that is not available to me when using --capture-image-and-download as I mentioned (gphoto2 --capture-image-and-download will only work with the lens in the AF setting).

I don't see any --get-config --autofocus command in the list of commands that indicates whether or not autofocus is on or off.

Continuous AF is currently "Off".

Thanks for you help and time. Greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canon tagging canon reports Nikon tagging Nikon reports
Projects
None yet
Development

No branches or pull requests

7 participants