From: Jacob Casper Date: Tue, 3 May 2022 17:36:50 +0000 (-0500) Subject: Cleanly handle no work X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=898ff83bcfa304b60950b99cb5bf57dac12ab4ba;p=hevc-pipeline.git Cleanly handle no work --- diff --git a/hevc-pipeline.sh b/hevc-pipeline.sh index 3574233..a6cc09a 100755 --- a/hevc-pipeline.sh +++ b/hevc-pipeline.sh @@ -4,6 +4,11 @@ mapfile -t hevc_films < <(ssh mbp 'find /srv/deluge/Downloads/ \( -name '"'"'*.m # copy all streams from input 0 except subs and annotations # -map -0:s -map -0:t \ +if [ ${#hevc_films[@]} -eq 0 ]; then + >&2 echo "no files to process" + exit 1 +fi + printf '%s\0' "${hevc_films[@]}" | xargs -0 -P 1 -I@ bash -c 'ssh mbp '"'"'cat "@"'"'"' | ffmpeg \ -fflags +igndts \