fswebcam
fswebcam copied to clipboard
Attempting to set non-existent control silently fails
I'm working with a Logitech webcam, and the controls have complex names:
griscom@dell:~$ fswebcam --list-controls
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Available Controls Current Value Range
------------------ ------------- -----
Brightness 128 (50%) 0 - 255
Contrast 32 (12%) 0 - 255
Saturation 32 (12%) 0 - 255
White Balance Temperature, Auto True True | False
Gain 45 (17%) 0 - 255
Power Line Frequency 60 Hz Disabled | 50 Hz | 60 Hz
White Balance Temperature 2800 (0%) 2800 - 6500
Sharpness 22 (8%) 0 - 255
Backlight Compensation 1 0 - 1
Exposure, Auto Aperture Priority Mode Manual Mode | Aperture Priority Mode
Exposure (Absolute) 83 (3%) 3 - 2047
Exposure, Auto Priority True True | False
Pan (Absolute) 0 (50%) -36000 - 36000
Tilt (Absolute) 0 (50%) -36000 - 36000
Focus (absolute) 0 (0%) 0 - 255
Focus, Auto False True | False
Zoom, Absolute 1 1 - 5
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
There are unsaved changes to the image.
griscom@dell:~$
A big barrier to figuring this out is that the --set
option for fswebcam fails silently if a control isn't known or supported by the camera. Since I didn't know that fswebcam would report each properly set control, and the control effects weren't clear (Logitech's fault, but it made it worse) I was just fishing around with different styled names.
Suggestion: have fswebcam either output a warning, or fail completely, if the user tries to set a control that doesn't exist.
Thanks, Dan
I ran across the same issue, and realized that the control parameters can be used as output with --list-control
. It's not pretty, but it works:
fswebcam --set "Zoom, Absolute"=2