From ab0e2818c066da79a8e82d5ba359330add1e9659 Mon Sep 17 00:00:00 2001 From: "gitlab.com/pepa65" Date: Thu, 8 Sep 2022 22:58:01 +0700 Subject: [PATCH] Remove upload and encoding after successful streaming --- encode | 4 ++-- stream | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/encode b/encode index 42f37c0..d796ea9 100755 --- a/encode +++ b/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} diff --git a/stream b/stream index c41b42d..73d930a 100755 --- a/stream +++ b/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"