jbilcke-hf HF staff commited on
Commit
7c03782
·
1 Parent(s): 2c58d43

restart the stream if it get shut down

Browse files
Files changed (1) hide show
  1. scripts/stream.sh +9 -2
scripts/stream.sh CHANGED
@@ -1,2 +1,9 @@
1
- echo "starting the FFMPEG stream, to merge video and audio and send it to the RTMP server.."
2
- ffmpeg -re -i video.pipe -i audio.pipe -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ echo "starting final stream loop.."
4
+ while true; do
5
+ sleep 1
6
+ echo "trying to create the final stream.."
7
+ ffmpeg -re -i video.pipe -i audio.pipe -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
8
+ echo "final stream got interrupted, will try again in 1 sec"
9
+ done