Initial commit
authorJacob Casper <dev@jacobcasper.com>
Tue, 3 May 2022 17:33:56 +0000 (12:33 -0500)
committerJacob Casper <dev@jacobcasper.com>
Tue, 3 May 2022 17:33:56 +0000 (12:33 -0500)
hevc-pipeline.sh [new file with mode: 0755]

diff --git a/hevc-pipeline.sh b/hevc-pipeline.sh
new file mode 100755 (executable)
index 0000000..3574233
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+mapfile -t hevc_films < <(ssh mbp 'find /srv/deluge/Downloads/ \( -name '"'"'*.mkv'"'"' -o -name '"'"'*.mp4'"'"' \) -type f -print0| xargs -0 -P 4 -I@ bash -c '"'"'test "hevc" == $(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "@") && echo "@"'"'"'' )
+
+# copy all streams from input 0 except subs and annotations
+# -map -0:s -map -0:t \
+
+printf '%s\0' "${hevc_films[@]}" | xargs -0 -P 1 -I@ bash -c 'ssh mbp '"'"'cat "@"'"'"' |
+       ffmpeg \
+        -fflags +igndts \
+        -i - \
+        -map 0 \
+        -c:v libx264 -level:v 4.1 -tag:v avc1 \
+        -crf 23 \
+        -vf \
+        format=yuv420p \
+        -preset veryfast \
+        -c:a copy \
+        -f matroska \
+        - | \
+        ssh mbp '"'"'cat > "@".new'"'"''