Fix corrupt-file detection in make-finals.sh

The previous check used || true which masked ffprobe's non-zero exit
code.  For files with a missing/partial moov atom ffprobe can print a
duration estimate then exit non-zero — the || true let that through.

Now use || raw_dur="" to honour the exit code, and add a second probe
for an actual video stream codec so files that report a duration but
have no decodable stream are also caught.

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-21 10:51:29 +00:00
parent 0ccfb2dae0
commit 62f1330d9c
+4 -2
View File
@@ -110,8 +110,10 @@ 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" 2>/dev/null || true)
if [ -z "$raw_dur" ] || [ "$raw_dur" = "N/A" ]; then
raw_dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$temp_file" 2>/dev/null) || raw_dur=""
vid_codec=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name \
-of csv=p=0 "$temp_file" 2>/dev/null) || vid_codec=""
if [ -z "$raw_dur" ] || [ "$raw_dur" = "N/A" ] || [ -z "$vid_codec" ]; then
echo "SKIP (corrupt/unreadable): $temp_file"
(( skipped++ )) || true
continue