Remove files after successul encoding & streaming

This commit is contained in:
gitlab.com/pepa65 committed 2022-09-08 22:53:40 +07:00
1 parent ccf1d7aee0
commit df64174631
3 files changed
+8 -7

No files matched your search

+3 -3
View File
@@ -19,6 +19,6 @@ RestreamSG) rtmp=rtmp://singapore.restream.io/live/$key ;;
esac
set -o pipefail # to get ffmpeg's returncode
! ffmpeg -re -y -i $in -c:v copy -c:a copy -f flv "$rtmp" |tail -n 20 >"$in.log" &&
echo "Error while streaming $1" >>"$log" ||
rm "$in.log" # Remove tailfile if no errors
ffmpeg -re -y -i "$in" -c:v copy -c:a copy -f flv "$rtmp" |tail -n 20 >"$in.log" &&
rm "$in.log" "$in" ||
echo "Error while streaming $1" >>"$log"