[FFmpeg-trac] #11461(avformat:open): Corruption of 608 captions data on extraction
FFmpeg
trac at avcodec.org
Mon Feb 10 04:13:04 EET 2025
#11461: Corruption of 608 captions data on extraction
-------------------------------------+-------------------------------------
Reporter: Zach | Owner: (none)
Type: defect | Status: open
Priority: important | Component: avformat
Version: git-master | Resolution:
Keywords: | Blocked By:
Captions,CC,EIA608 |
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Zach):
I was able to get a working .scc file from the output of ffmpeg by the
following modifications in notpad++ with these two steps.
1: Find and replace all \n with \r\n (to match working files, not sure if
it matters)
2: Find and replace all with regex:
{{{
\r\n\r\n.{12}(?!9420
}}}
) with a space character
I noticed that in the files from other programs that are working, almost
every line starts with 9240 which is the resume caption loading command
for channel cc1 and 94ae which is the erase non displayed memory buffer
code. 9240 might only apply to pop on captions so a bit of research might
need to be done.
9240 Resume caption loading (pop up style) (not frame sensitive)
94ae Clear Buffer (not frame sensitive)
942f End of Caption (display on screen) (Frame sensitive)
942c Erase Caption (remove caption from screen) (Frame Sensitive)
Obviously the end of caption and erase caption commands must happen on a
specific timecode to preserve the timing of the captions track.
I believe what is happening here is that ffmpeg is generating an .scc file
with non drop frame time code as evidenced by a colon instead of semicolon
for the frame field in the timecode. Since the caption codes are
distributed individually on each frame of video, there is guaranteed to be
caption data on the frame numbers that are absent from a dropped frame
timeline.
Premiere or SubTitleEdit will then import the .scc file and align by
timecode. Any data stored on the dropped frames is destroyed and the
caption track becomes corrupted.
Required Information:
Identify frame sensitive codes to make sure the time code is not modified:
Identify start codes to assist in grouping caption codes
Identify the max number of captions codes per frame
Solution: Group captions codes sufficiently to avoid captions codes on
dropped frame numbers while following a rule set to prevent altering the
caption display times.
Sources:
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_FORMAT.HTML
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_TOOLS.HTML#ccd
https://docs.inqscribe.com/2.2/format_scc.html
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11461#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list