Remove upload and encoding after successful streaming
This commit is contained in:
parent
df64174631
commit
ab0e2818c0
4
encode
4
encode
@ -70,8 +70,8 @@ rm "$file"-*
|
||||
finish=$(date +'%Y-%m-%d at %H:%M:%S')
|
||||
((error)) && Mail 2 "Error encoding $name"
|
||||
|
||||
# Remove tailfiles and upload if no errors
|
||||
rm -- "$file".?log "$file"
|
||||
# Remove tailfiles if no errors
|
||||
rm -- "$file".?log
|
||||
|
||||
# Schedule cron job
|
||||
m=${date:13:2} m=${m#0} h=${date:11:2} h=${h#0}
|
||||
|
||||
3
stream
3
stream
@ -18,7 +18,8 @@ RestreamSG) rtmp=rtmp://singapore.restream.io/live/$key ;;
|
||||
*) rtmp=rtmp://live.restream.io/live/$key
|
||||
esac
|
||||
|
||||
# Stream, log it, and remove all files if successful
|
||||
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" &&
|
||||
rm "$in.log" "$in" ||
|
||||
rm "$in.log" "$in" "${in%.mp4}" ||
|
||||
echo "Error while streaming $1" >>"$log"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user