make-finals.sh: skip corrupt temp files (moov atom not found)

Check ffprobe output before encoding — empty/N/A duration means the
file is corrupt or truncated; skip with a clear message rather than
passing a bad input to ffmpeg.

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-20 20:02:04 +00:00
parent 26414f9883
commit 387b84f367
+6 -1
View File
@@ -108,7 +108,12 @@ while IFS= read -r -d '' temp_file; do
continue
fi
raw_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_file")
raw_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_file" 2>/dev/null || true)
if [ -z "$raw_dur" ] || [ "$raw_dur" = "N/A" ]; then
echo "SKIP (corrupt/unreadable): $temp_file"
(( skipped++ )) || true
continue
fi
speed=$(echo "scale=6; $raw_dur / $target" | bc)
echo "MAKE $cam/$ASTRO_YEAR/$SEASON/Mvt$MVT_NUM/$(basename "$final") [${speed}x]"