Created
February 23, 2022 07:10
-
-
Save derrickturk/cf19e664f1d0c7ba5eb37380a54f2139 to your computer and use it in GitHub Desktop.
stream video from a Raspberry Pi 2, also, bash is hard
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
#!/usr/bin/env bash | |
trap "trap - SIGTERM && echo 'shutting down!' && kill -- -$$" SIGINT SIGTERM EXIT | |
echo "kill me with 'kill $$'" | |
(nohup raspivid -o - -t 0 -w 800 -h 600 -fps 15 2>/dev/null | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8080/}' :demux=h264 --h264-fps=15 >/dev/null 2>&1) & | |
PID=$! | |
wait $PID | |
trap - SIGINT SIGTERM EXIT | |
wait $PID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment