mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 20:37:30 +00:00
When ffprobe omits the video stream's own `duration` field, `extractMediaMetadata` falls back to the container duration (`format.duration`), which includes the longest stream in the container. Stock and looping clips commonly have an audio track 2x the video length, inflating `videoStreamDurationSeconds` and causing the downstream coverage gate to expect twice the frames FFmpeg can actually produce — the "50% cluster" failure pattern. Cross-check with `nb_frames / fps` when the stream duration is absent. If the frame-derived duration is >10% shorter than the container, use it instead. This corrects the inflation at probe time without requiring a second ffprobe pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>