Skip to content

SCC Reader configurable framerate #509

@powelli

Description

@powelli

Context

SCC files encode timecodes using a frame-based format, but the current reader assumes a fixed framerate (typically 29.97 fps). SCC (Scenarist Closed Captions) was developed in the early days of digital broadcast, where 29.97 fps NTSC was essentially the only target - so a fixed framerate assumption was baked in from the start.

In practice, SCC files are used with a variety of framerates (23.976, 25, 30, etc.), and there's no way to tell from the file itself which one applies, that context comes from elsewhere such as the video the captions are authored against.

Without configurable framerate support, timecode-to-time conversions can be subtly wrong, causing captions to drift out of sync when the source material isn't 29.97 fps. Support for frame rate configuration was included in the SCC Writer configuration added in #441

Proposed changes

  • Allow callers to pass either a frame_rate (like SccWriterConfiguration) or fps (like IMSCWriterConfiguration) when invoking the SCC reader.
  • Retain 29.97 as the default to preserve existing behaviour.
  • Drop frame vs non-drop frame will still be inferred from the SCC timecode format, therefore the parameter will not define it (unlike e.g. 29.97NDF for the SCC writer)
  • The provided framerate will be used when converting frame-based timecodes to the internal time-based model

frame_rate: SCCFrameRate = field(
default=SCCFrameRate.FPS_2997_DF,
metadata={"decoder": SCCFrameRate.from_value}
)

fps: Optional[Fraction] = field(
default=None,
metadata={"decoder": FractionDecoder()}
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions