I am trying to manually control the exposure of my camera, but the setting is only briefly active, but then apparently still an auto mode seems to be active, as I can see on the camera images.
My camera has the following controls:
v4l2-ctl --list-ctrls-menus
brightness 0x00980900 (int) : min=-127 max=128 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=30 step=1 default=15 value=15
saturation 0x00980902 (int) : min=0 max=127 step=1 default=54 value=54
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=20 max=250 step=1 default=88 value=88
gain 0x00980913 (int) : min=0 max=10 step=1 default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2500 max=7000 step=1 default=6000 value=6000 flags=inactive
sharpness 0x0098091b (int) : min=0 max=60 step=1 default=10 value=10
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=1
1: Manual Mode
3: Aperture Priority Mode
exposure_absolute 0x009a0902 (int) : min=78 max=1250 step=1 default=312 value=1250
exposure_auto_priority 0x009a0903 (bool) : default=0 value=0
I set and verify, while watching the image through a basic opencv
viewer, which doesn't do any controlling:
# Verify initial setting
$ v4l2-ctl -C exposure_auto
exposure_auto: 3
# Set auto-exposure to "Manual exposure time, manual iris."
$ v4l2-ctl -c exposure_auto=1
# Verify that manual setting is active
$ v4l2-ctl -C exposure_auto
exposure_auto: 1
# Set an absolute exposure value
$ v4l2-ctl -c exposure_absolute=1000
# Verify set absolute exposure
$ v4l2-ctl -C exposure_absolute
exposure_absolute: 1000
I also play with the exposure_auto_priority
setting.
However, when I change the exposure, I can see the effect very quickly on the images from the camera, which then immediately seems to go back to the "auto" mode. I.e. the camera is adjusting it's brightness automatically.
The same effect I'm observing when I use guvcview
, which basically gives me a slider for each of the above controls. When I change the exposure, it briefly applies, but then seems to apply auto-exposure. Although the setting itself can be confirmed to be as set (using v4l2-ctl -C ...
).
Disabling white_balance_temperature_auto
works, and I also tried to fiddle with any other value, but I couldn't find any dependency to the exposure.
What could it be that is overruling the manual exposure settings?
Update
Some system information:
Kernel:
$ uname -r
5.3.0-51-generic
cat /proc/version
Linux version 5.3.0-51-generic (buildd@lgw01-amd64-034) (gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)) #44-Ubuntu SMP Wed Apr 22 21:09:44 UTC 2020
Media:
$ media-ctl -p
Failed to enumerate /dev/media0 (-13)
$ ls /dev/media*
/dev/media0 /dev/media1 /dev/media2
V4L2:
$ v4l2-ctl --all
Driver Info:
Driver name : uvcvideo
Card type : HBV HD CAMERA: HBV HD CAMERA
Bus info : usb-0000:05:00.3-1.1
Driver version : 5.3.18
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : 'MJPG' (Motion-JPEG)
Field : None
Bytes per Line : 0
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1920, Height 1080
Default : Left 0, Top 0, Width 1920, Height 1080
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:
Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-127 max=128 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=30 step=1 default=15 value=15
saturation 0x00980902 (int) : min=0 max=127 step=1 default=54 value=54
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=20 max=250 step=1 default=88 value=88
gain 0x00980913 (int) : min=0 max=10 step=1 default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
white_balance_temperature 0x0098091a (int) : min=2500 max=7000 step=1 default=6000 value=6000 flags=inactive
sharpness 0x0098091b (int) : min=0 max=60 step=1 default=10 value=10
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=0
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=78 max=1250 step=1 default=312 value=312 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=1
v4l2-ctl --all
andmedia-ctl -p
? – Hoggard