Everything works perfectly. The version 3 offers auto focus. I notice the camera constantly auto focusing. Is there a plugin or other way to turn off auto focus and manually set the focus? I see a plugin for Arducam, but I am not sure if this would control other webcams as well.
What did you already try to solve it?
I assume if I set I2C to 0, auto focus would be disabled, but I would still need to have a way to manually focus the camera
You have to adjust the configuration in /boot/camera-streamer/libcamera.conf file. See below:
I wrote this previously when working out how to do it:
You can definitely turn off autofocus by using
OPTIONS='--camera-options="AfMode=0"
The closest explanation I could find of the values was the Raspberry Pi documentation - which doesn't use the same values. It does list some AF modes, but with no numbers attached. Source.
I believe it is:
0: 'manual' focus - allows to use LensPosition
1: 'auto' focus - auto focus once when the camera starts up
2: 'continuous' AF - what the default is in this image - continuously adjusts the focus to try and keep the image sharp.
I then played around with LensPosition in the same way as autofocus, eg.
and could set the different values between 0 and 32 and it changed the focal point a lot. Focus scales aren't really linear, so you might not need 16, so I suspect trial and error might help. Alternatively, use AFMode=1 to autofocus once.
I have a Pi Cam V3. Using the manual focus mode and experimenting with the values between 0-32 I was able to get the camera to focus where I want it without it continually trying to auto-focus.