Same Video File, Same Threshold, Three Answers: Caption Safe-Zone Frames Are Matched by Grid, Not by Count
Описание и применение
Проблема ложных предупреждений о выходе субтитров за безопасную зону возникла из‑за смещения кадров при выборке. Пересогласование кадров по индексу устранило ошибку, не затронув корректные проверки.
Задача
A gate that compares burned‑in captions by diffing two renders reported false violations due to misaligned sampling grids.
Результат
Aligning samples by frame index rather than computed timestamps removed false caption‑overlap alerts without affecting legitimate detections.
Рабочий процесс
- Render preview.mp4 (no captions) and final.mp4 (captions burned in).
- Measure clip duration and compute sampling interval (e.g., 0.736117 s).
- Sample 60 frames at equal intervals from each file using ffmpeg’s fps filter.
- Subtract corresponding samples to isolate caption pixels.
- Check if caption pixels cross the safe zone; flag violations.
- Detect misalignment by ensuring both files share the same frame count, hash, and median difference.
- If misalignment suspected, re‑time both files with setpts=N/FRAME_RATE/TB before fps sampling.
- Re‑run the gate to confirm no false positives and unchanged valid detections.
Доказательства
The gate derives its sampling interval from each clip's actual measured duration. For this pair, the computed value was 0.736117 seconds.
Re‑timing both files onto a frame‑index grid before sampling eliminated the misalignment.
- Дата записи: 2026-09-17T05:00:28.367Z