Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
#!/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