2 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 "@"'"'"'' )
4 # copy all streams from input 0 except subs and annotations
5 # -map -0:s -map -0:t \
7 if [ ${#hevc_films[@]} -eq 0 ]; then
8 >&2 echo "no files to process"
12 printf '%s\0' "${hevc_films[@]}" |
xargs -0 -P 1 -I@ bash
-c 'ssh mbp '"'"'cat "@"'"'"' |
17 -c:v libx264 -level:v 4.1 -tag:v avc1 \
25 ssh mbp '"'"'cat > "@".new'"'"''
26 # TODO this cat generates an .mkv container with invalid timestamps or something else Jellyfin + HLS
27 # can't understand. Requires reconstruction on the other side.
28 # it's often re-encoded at >150x speed so it's not important, but maybe it should be piped to ffmpeg
29 # on the other system automatically.
30 # ffmpeg -i $out.mkv.new -map 0 -vcodec copy -acodec copy $out.mkv.new.mkv