first commit
This commit is contained in:
24
scripts/stream.sh
Executable file
24
scripts/stream.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
DVR_PATH=/media
|
||||
SCREEN_MODE=$(</config/scripts/screen-mode)
|
||||
REC_FPS=$(</config/scripts/rec-fps)
|
||||
|
||||
PID=0
|
||||
BUTTON=21
|
||||
|
||||
#pixelpilot --osd --osd-config /config/config_osd.json --screen-mode $SCREEN_MODE --dvr-framerate $REC_FPS --dvr-fmp4 --dvr-template $DVR_PATH/record_%Y-%m-%d_%H-%M-%S.mp4 &
|
||||
pixelpilot --osd --osd-config /config/config_osd.json --screen-mode $(</config/scripts/screen-mode) --dvr-framerate $(</config/scripts/rec-fps) --dvr-fmp4 --dvr-template $DVR_PATH/record_%Y-%m-%d_%H-%M-%S.mp4
|
||||
|
||||
PID=$!
|
||||
|
||||
while true; do
|
||||
# Wait for button click
|
||||
if [ $(gpio read $BUTTON) -eq 1 ]; then
|
||||
echo "toggle DVR for $PID"
|
||||
kill -SIGUSR1 $PID
|
||||
# wait 2s to let user release the button
|
||||
sleep 2
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
Reference in New Issue
Block a user