This commit is contained in:
bel
2021-09-14 06:30:17 -06:00
commit 7ab1723a5e
327 changed files with 127104 additions and 0 deletions

37
MovieNight/entrypoint.sh Executable file
View File

@@ -0,0 +1,37 @@
#! /bin/bash
function main() {
listen &
while true; do
sleep 10
publish
done
}
function listen() {
if [ ! -d /main ]; then
go build && ./MovieNight
elif [ ! -e /main/exec-MovieNight ]; then
/main/MovieNight
else
/main/exec-MovieNight
fi
kill -9 1
}
function publish() {
ffmpeg \
-i rtsp://${RTSP_IP:-192.168.0.83}:${RTSP_PORT:-8554}/unicast \
-preset ultrafast \
-filter:v scale=-1:${RES:-720} \
-vcodec libx264 \
-acodec copy \
-f flv \
-b:v ${KBPS:-500}k \
-b:a 0k \
rtmp://localhost:1935/live/ALongStreamKey
}
if [ "$0" == "$BASH_SOURCE" ]; then
main "$@"
fi