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()} |
|
) |
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
frame_rate(likeSccWriterConfiguration) orfps(likeIMSCWriterConfiguration) when invoking the SCC reader.29.97NDFfor the SCC writer)ttconv/src/main/python/ttconv/scc/config.py
Lines 129 to 132 in a426e4e
ttconv/src/main/python/ttconv/imsc/config.py
Lines 96 to 99 in a426e4e