skip vod clips that start after their audio ends

When a camera's audio dropped out, a recording segment could end its audio early. If a playback range started past that point in the segment, nginx-vod saw no audio track in the first clip, failed the whole range with a track count mismatch, and left the player spinning for up to an hour of footage. Recording now stores each segment's audio length alongside its keyframe index, from the same ffprobe pass, and plan_clip skips a clip whose window starts at or after its audio ends when the range has other clips. A range made of only that clip still plays video-only, and legacy rows without the new column are unchanged.
This commit is contained in:
Josh Hawkins
2026-10-25 15:37:28 -05:00
parent 7738f022e7
commit 0ed5561553
9 changed files with 208 additions and 38 deletions
@@ -0,0 +1,14 @@
"""Peewee migrations -- 040_add_recordings_audio_duration.py."""
import peewee as pw
SQL = pw.SQL
def migrate(migrator, database, fake=False, **kwargs):
# nullable so legacy rows stay NULL, meaning unknown
migrator.sql('ALTER TABLE "recordings" ADD COLUMN "audio_duration" REAL')
def rollback(migrator, database, fake=False, **kwargs):
pass