document current most important todo for jellyfin streaming
[hevc-pipeline.git] / hevc-pipeline.sh
index 3574233..4508e7a 100755 (executable)
@@ -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 \
@@ -18,3 +23,8 @@ printf '%s\0' "${hevc_films[@]}" | xargs -0 -P 1 -I@ bash -c 'ssh mbp '"'"'cat "
         -f matroska \
         - | \
         ssh mbp '"'"'cat > "@".new'"'"''
+# TODO this cat generates an .mkv container with invalid timestamps or something else Jellyfin + HLS
+# can't understand. Requires reconstruction on the other side.
+# it's often re-encoded at >150x speed so it's not important, but maybe it should be piped to ffmpeg
+# on the other system automatically.
+# ffmpeg -i $out.mkv.new -map 0 -vcodec copy -acodec copy $out.mkv.new.mkv