jbilcke-hf HF Staff commited on
Commit
11512fd
·
1 Parent(s): 52d0ab4

improve robustness

Browse files
Files changed (2) hide show
  1. scripts/audio.sh +1 -1
  2. scripts/stream.sh +1 -1
scripts/audio.sh CHANGED
@@ -10,6 +10,6 @@ while true; do
10
  for f in $WEBTV_AUDIO_STORAGE_PATH*.mp3
11
  do
12
  echo "playing $f"
13
- ffmpeg -re -i "$f" -vn -acodec copy -f mp3 -y audio.pipe 2>/dev/null
14
  done
15
  done
 
10
  for f in $WEBTV_AUDIO_STORAGE_PATH*.mp3
11
  do
12
  echo "playing $f"
13
+ ffmpeg -fflags +discardcorrupt -re -i "$f" -vn -acodec copy -f mp3 -y audio.pipe 2>/dev/null
14
  done
15
  done
scripts/stream.sh CHANGED
@@ -5,7 +5,7 @@ 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
- ffmpeg -re -i video.pipe -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
9
 
10
  echo "final stream got interrupted, will try again in 1 sec"
11
  done
 
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
+ ffmpeg -fflags +discardcorrupt -re -i video.pipe -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
9
 
10
  echo "final stream got interrupted, will try again in 1 sec"
11
  done