Created
June 22, 2020 12:15
-
-
Save kndt84/7a6984a0ee0b85db1a7c5c5de495283e to your computer and use it in GitHub Desktop.
VLC Player RTMP auto play with Raspberry Pi
This file contains hidden or 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 | |
PROG="VLC_STARTER" | |
IP="" | |
ID="" | |
PASS="" | |
export DISPLAY=:0 | |
if [ "$1" = "" ]; then | |
echo "Usage: $0 [RGB|THERMO] boot" | |
exit 1 | |
fi | |
[ "$2" = "boot" ] && STARTUP_SLEEP=60 | |
MUTEX="/tmp/$PROG.running" | |
exec 9>"$MUTEX" | |
flock --exclusive --nonblock 9 | |
[ $? -eq 0 ] || exit # Somebody has stolen the lock! | |
# Sleep some time till the network and the system clock are stabilized | |
[ -n "$STARTUP_SLEEP" ] && { | |
echo "Waiting the system becomes stable" >&9 | |
echo "Waiting the system becomes stable " | |
sleep $STARTUP_SLEEP | |
STARTUP_SLEEP= | |
} | |
if [ "$1" = "RGB" ]; then | |
vlc -f rtsp://${ID}:${PASS}@${IP} | |
else | |
vlc -f rtsp://${ID}:${PASS}@${IP}/Streaming/channels/201 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting for crontab