video: handle unknown/short durations in thumb + preview gen #87
Reference in New Issue
Block a user
Delete Branch "fix/video-thumb-preview-edge-cases"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
get_duration_secondsnow returnsOption<f64>and falls back fromformat=durationtostream=duration. Empty stdout no longerparse-panics with "cannot parse float from empty string", which was
poisoning the preview-clip row with status=failed and re-queueing every
full scan (notably for GoPro LRV files).
generate_preview_cliphandlesthe unknown-duration case by transcoding the whole file (capped at 10s).
generate_video_thumbnailseeks to ~50% of the probed duration insteadof a hardcoded
-ss 3, with a first-frame fallback when the probereturns nothing. Fixes the loop where short Snapchat clips (<3s) got
"missing thumbnail" logged on every scan because ffmpeg exited 0
without writing a frame, and never wrote the .unsupported sentinel
either.
Adds unit tests for
parse_ffprobe_durationcovering the empty-output,N/A, multi-line, non-positive, and non-finite cases.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com