Highlight Window Resolution Algorithm
Convert per-slide audio durations into deterministic frame windows, then map highlight slide ranges onto that timeline.
Step 1: Build Slide Timeline
Use fps=30 and add one second padding per slide:
audioFrames = ceil((audioDurationMs / 1000) * fps)
slideDurationFrames = audioFrames + fps
Each timeline entry stores:
startFrame,endFramestartMs,endMs,durationMs- source
audioDurationMs
Step 2: Normalize Highlight Ranges
Allowed shapes:
[n][n, n+1]
Reject:
- empty ranges
- negative indexes
- non-consecutive two-slide ranges
Step 3: Resolve or Drop
For each highlight:
- Find first and last slide in timeline.
- If out of bounds, record in
droppedwith reason. - Else produce window with start/end frame and millisecond bounds.
Why This Pattern
- Deterministic clip extraction boundaries.
- Simple validation surface.
- Clear audit trail for dropped highlight definitions.