summaryrefslogtreecommitdiff
path: root/v4l-tool
diff options
context:
space:
mode:
authorgrothedev <grothedev@gmail.com>2024-06-17 13:34:13 -0500
committergrothedev <grothedev@gmail.com>2024-06-17 13:43:09 -0500
commit2feba75a80261b7b8dfb257218e6d0ff3546ca14 (patch)
tree5e1accfbae46586c78ebc2cf3536e002be9fbebb /v4l-tool
parent702ad77194129290cfd4d2b45fcf15f862a84750 (diff)
added v4l2-ctl tool which is WIP. also apparently my local git settings were reset at some point and i didn't even realize it
Diffstat (limited to 'v4l-tool')
-rwxr-xr-xv4l-tool/brght1
-rwxr-xr-xv4l-tool/cntrst1
-rwxr-xr-xv4l-tool/satrtn1
-rw-r--r--v4l-tool/settings-setter.sh21
4 files changed, 24 insertions, 0 deletions
diff --git a/v4l-tool/brght b/v4l-tool/brght
new file mode 100755
index 0000000..9ebb81f
--- /dev/null
+++ b/v4l-tool/brght
@@ -0,0 +1 @@
+v4l2-ctl -C brightness | cut -d' ' -f2
diff --git a/v4l-tool/cntrst b/v4l-tool/cntrst
new file mode 100755
index 0000000..df7c96c
--- /dev/null
+++ b/v4l-tool/cntrst
@@ -0,0 +1 @@
+v4l2-ctl -C contrast | cut -d' ' -f2
diff --git a/v4l-tool/satrtn b/v4l-tool/satrtn
new file mode 100755
index 0000000..a061cb7
--- /dev/null
+++ b/v4l-tool/satrtn
@@ -0,0 +1 @@
+v4l2-ctl -C saturation | cut -d' ' -f2
diff --git a/v4l-tool/settings-setter.sh b/v4l-tool/settings-setter.sh
new file mode 100644
index 0000000..2c2d53a
--- /dev/null
+++ b/v4l-tool/settings-setter.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+#this daemon will keep the brightness, contrast, saturation of the webcam set based on the time of day
+
+#brightness. highest during darkest
+b_mx=245
+b_mn=145
+
+#contrast. highest during darkest
+c_mx=160
+c_mn=100
+
+#saturation. constant for now
+
+while [[ true ]]; do
+ th=`date +%H`
+ tm=`date +%M`
+ p=$(((60*${th}+${tm})/1440)) #percent through day
+
+ sleep 15
+done