V4L2 change default setting?

If you have Video4Linux Control Pannel, you might try un checking the Exposure_Auto_Priority check box at the bottom and see if that helps...

enter image description here

Hope it helps... Good Luck!


Since the settings will be lost after each boot, you should run a script at session startup to apply values you generate using the Video4Linux Panel.

To see the adjusted values type on terminal:

v4l2-ctl --all

After create your script, and add it to your startup session...

Here is my startup script:

#!/bin/bash
v4l2-ctl \
--set-ctrl=brightness=150 \
--set-ctrl=contrast=51 \
--set-ctrl=saturation=32 \
--set-ctrl=white_balance_temperature_auto=0 \
--set-ctrl=gain=90 \
--set-ctrl=power_line_frequency=1 \
--set-ctrl=white_balance_temperature=1140 \
--set-ctrl=sharpness=24 \
--set-ctrl=backlight_compensation=1 \
--set-ctrl=exposure_auto=1 \
--set-ctrl=exposure_absolute=870 \
--set-ctrl=exposure_auto_priority=1

I hope that this helps...


You can also use the udev subsystem to establish the settings when the device is plugged in or the machine boots.

For example, here is how I set the power line frequency on my Logitech HD Pro C920 Webcam, which lsusb says has the USB ID 046d:082d.

As root create a new world-readable file /etc/udev/rules.d/99-local-webcam.rules. It contains:

SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="082d", PROGRAM="/usr/bin/v4l2-ctl --set-ctrl power_line_frequency=1 --device /dev/%k"

You can follow the same recipe, modifying the USB ID and the v4l2-ctl parameters to suit your exact needs. You can test the v4l2-ctl parameters from the command line until you are comfortable that they will work, then put that text into the udev rules file.

The advantage of this approach is that it "just works". Every time the device is plugged in then the settings are applied. If you are a systems administrator for a lot of machines then you can push out rules files for all your institution's equipment, they aren't used until that USB ID is plugged into the machine.