Webcam Autofocus
Hello, everyone,
I have a question about the autofocus of the webcam. I would like to switch it off.
When I go to the local side of the M-JPEG streamer I can turn off the focus and set a manual value. Unfortunately this setting is not saved.
I then sent the following commands via SSH:
sudo v4l2-ctl --set-ctrl=focus_auto=0
sudo v4l2-ctl --set-ctrl=focus_absolute=40
These commands disable the autofocus and set a manual focus. Unfortunately you have to send them again after each restart.
So I wanted to ask you if there is a possibility to set these commands always at system start.
Unfortunately an entry in the rc.local did not work.
Comments
I would also like to switch off the autofocus (Cannot open device /dev/video0, exiting.)
ps aux | grep mjpg
shows running mjpg streamer instances with command line. The -d parameter is your device and you also see the assigned port. From there it should be easy to change the parameter.
For some reason the buster now seems to show multiple entries per webcam but only one will work.
So I get this displayed
I can not interpret it so well what and how to understand it or how I find out how I enter my cam
when i use
sudo v4l2-ctl -d /dev/video0 --set-ctrl=focus_auto=0
should do it.
sudo nano /usr/local/Repetier-Setup/bin/startAllCams
and add it after the last line. Then it always runs after the streamer is started.
thaks for this "noob" howto now works all fine with the cam as I imagine it
i love the repetier server to make my prints!
thanks a lot
not sure why,
will list available controls for your device.
and i found that my camera doesn't support auto focus
i was using the LG V23g camera and i verified it from the MJPG-streamer controls
thanks a lot by the way!
I've finally got a working version of Repetier Server,
Logitech c920 is working fine but only problem now I need to turn autofocus off and set a fixed value of 50.
Back I the day I managed to fix but now I'm a bit clue less where I need to set?
I added above to sudo nano /usr/local/Repetier-Setup/bin/startAllCams
that didn't work, can you guide me please
v4l2-ctl --device path/to/video_device --set-ctrl=control_name=value
I think with correct device it should change behaviour. You can omit sudo in the script I think. If I remember right it gets started with sudo already.
ls -l /dev/v4l/by-id/
and use full path to the one that looks correct.
this is what I ended up with which works.
v4l2-ctl —set-ctrl=focus_automatic_continuous=0
v4l2-ctl —set-ctrl=focus_absolute=50