Skip to main content

Module tc_subtitle_sync

Module tc_subtitle_sync 

Source
Expand description

Subtitle-to-timecode synchronization utilities.

Provides tools for aligning subtitle cue timestamps with SMPTE timecodes, applying linear and offset corrections, and detecting drift between subtitle streams and the master timecode.

Structs§

SubtitleCue
A single subtitle cue with in/out timecodes.

Functions§

apply_frame_offset
Offset correction: shift all cues by a fixed number of frames.
apply_linear_stretch
Linear time-stretch: scale all cue times relative to anchor_frame by factor.
compute_average_drift
Compute the average drift (in frames) between subtitle cue-in times and a set of expected reference timecodes.
find_overlaps
Detect overlapping cues and return pairs of indices.
sort_cues_by_in
Sort a list of cues by their in-timecode.