Created
February 7, 2021 17:52
-
-
Save gene1wood/a05dc51531be0b7c02b99b4d5a7e8ebd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
if [ -n "$2" ]; then | |
percent="$2" | |
else | |
percent=0 | |
fi | |
camera="$(v4l2-ctl --list-devices | grep -A1 "$1" | tail -1 | awk '{print $1}')" | |
$(v4l2-ctl -d "$camera" -l | awk '$1 == "white_balance_temperature" {print "export "$5" "$6}') | |
(( range = max - min )) | |
(( step = range / 100 )) | |
(( temp = percent * step + min )) | |
v4l2-ctl -d "$camera" --set-ctrl=white_balance_temperature_auto=0 | |
v4l2-ctl -d "$camera" --set-ctrl=white_balance_temperature=$temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
temp=25 | |
else | |
temp=$1 | |
fi | |
~/bin/set-whitebalance "Integrated_Webcam_HD" $temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment