OpenWRT - Home Automation - Controlling a simple relay board

sezione dedicata ai sistemi operativi alternativi Open Source

How to control values of the cam in mjpg-streamer/motion

Messaggio da leggereda root » 13/11/2016, 18:22

The opkg version of mjpg-streamer has no control options for the camera. If you want to control exposure, brightness and other options you'll need to install uvcdynctrl.
By editing the cam values with this program I got big improvements in terms of sharpness and color fidelity ;)

quick instructions:

install control program:
opkg install uvcdynctrl

test the program and check the list of webcam available commands:
/usr/bin/uvcdynctrl -c

copy cam internal values to a file:
/usr/bin/uvcdynctrl -W /etc/config/uvcdynctrl

edit file with cam values:
vi /etc/config/uvcdynctrl

example:
#V4L2/CTRL/0.0.2
APP{"libwebcam"}
# control data
#Brightness
ID{0x00980900};CHK{30:255:1:133}=VAL{133}
#Contrast
ID{0x00980901};CHK{0:10:1:5}=VAL{8}
#Saturation
ID{0x00980902};CHK{0:200:1:83}=VAL{120}
#White Balance Temperature, Auto
ID{0x0098090c};CHK{0:1:1:1}=VAL{1}
#Power Line Frequency
ID{0x00980918};CHK{0:2:1:2}=VAL{2}
#White Balance Temperature
ID{0x0098091a};CHK{2800:10000:1:4500}=VAL{4500}
#Sharpness
ID{0x0098091b};CHK{0:50:1:25}=VAL{45}
#Backlight Compensation
ID{0x0098091c};CHK{0:10:1:0}=VAL{0}
#Exposure, Auto
ID{0x009a0901};CHK{0:1:1:1}=VAL{3}
#Exposure (Absolute)
ID{0x009a0902};CHK{5:20000:1:156}=VAL{156}
#Pan (Absolute)
ID{0x009a0908};CHK{-201600:201600:3600:0}=VAL{201600}
#Tilt (Absolute)
ID{0x009a0909};CHK{-201600:201600:3600:0}=VAL{201600}
#Focus (absolute)
ID{0x009a090a};CHK{0:40:1:0}=VAL{3}
#Focus, Auto
ID{0x009a090c};CHK{0:1:1:0}=VAL{1}
#Zoom, Absolute
ID{0x009a090d};CHK{0:10:1:0}=VAL{1}


note: you need to change the value under braces {*}
the first two numbers in CHK{x:x:x:x} are in order the minimum and the maximum acceptable value you can use for each parameter


then to apply 'on-the-fly' the new values (don't need to restart mjpg-streamer):
/usr/bin/uvcdynctrl -L /etc/config/uvcdynctrl

note: ignore errors!


add the above command to /etc/rc.local to load and apply the new cam values at reboot:
vi /etc/rc.local

#...
/usr/bin/uvcdynctrl -L /etc/config/uvcdynctrl
exit 0
Maurizio
Avatar utente
root
Amministratore
 
Messaggi: 347
Iscritto il: 10/04/2012, 10:55
Località: Ovada

Precedente

Torna a OpenWRT e sistemi operativi vari

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite

cron