forked from BrodieRobertson/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixcam
executable file
·25 lines (22 loc) · 837 Bytes
/
fixcam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Simple script to set my webcam settings
device=$(v4l2-ctl --list-devices | grep "C920" -A 1 | grep "/dev/video." -o)
v4l2-ctl -d $device --set-ctrl=focus_auto=0
v4l2-ctl -d $device --set-ctrl=exposure_auto=1
v4l2-ctl -d $device --set-ctrl=white_balance_temperature_auto=0
v4l2-ctl -d $device --set-ctrl=focus_absolute=40
v4l2-ctl -d $device --set-ctrl=exposure_absolute=300
v4l2-ctl -d $device --set-ctrl=saturation=128
v4l2-ctl -d $device --set-ctrl=contrast=128
v4l2-ctl -d $device --set-ctrl=sharpness=128
v4l2-ctl -d $device --set-ctrl=white_balance_temperature=4800
v4l2-ctl -d $device --set-ctrl=zoom_absolute=500
if [ "$1" = "night" ]; then
if [ ! -z $device ]; then
v4l2-ctl -d $device --set-ctrl=brightness=140
fi
else
if [ ! -z $device ]; then
v4l2-ctl -d $device --set-ctrl=brightness=140
fi
fi