log stream

This commit is contained in:
gitlab.com/pepa65 2022-09-04 21:38:26 +07:00
parent 042ac1ff71
commit 4843373cd4

6
stream
View File

@ -17,5 +17,7 @@ RestreamSG) rtmp=rtmp://singapore.restream.io/live/$key ;;
*) rtmp=rtmp://live.restream.io/live/$key *) rtmp=rtmp://live.restream.io/live/$key
esac esac
ffmpeg -re -y -i $in -c:v copy -c:a copy -f flv "$rtmp" || set -o pipefail # to get ffmpeg's returncode
echo "Error while streaming $1" >>"$log" ! 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