You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
01
0:00:00,000 --> 00:00:00,000
02
0:00:00,000 --> 00:00:14,033
From New York,
this is Democracy Now!
03
0:00:14,033 --> 00:00:14,033
Here, I believe:
The first scc cue should be ignored (simply clearing the screen)
The second cue should be timestamped as 00:00:14;01 + the number of frames before 0x94 0x2f, as the cue starts by initiating pop-on mode (0x94 0x20, "resume_caption_loading"). This seems to match pretty well with the actual media, as the lady starts saying "From New-York" some time during the 15th second.
I suspect the last cue isn't drained, probably trivial to fix
From a quick look at the code, I think there are two issues at play here:
libcaption decides that frames are READY too often, for example when encountering 0x94 0x2c (erase_display_memory) , this leads to the creation of a cue.
caption_frame_decode updates its timestamp before ignoring duplicate control commands, this explains the offset-by-1 issue, I believe this could be improved further by tracking the current mode, and in pop on mode updating the timestamp at the end of the caption instead of when the last call returned READY, this would however require making assumptions about the framerate (are SCC files always 29.97 fps?)
The text was updated successfully, but these errors were encountered:
Fixesszatmary#59
* pop_on mode requires incrementing the frame timestamp until
end_of_caption is encountered.
* caption_frame_decode now always updates the timestamp of the
frame when the timestamp parameter != -1. This requires that callers
only pass a valid timestamp when a new one is encountered, for
example with SCC the timestamp at the start of the cue, then -1
until the next new timestamp.
* A new enum member is added for the return value, LIBCAPTION_CLEAR.
It allows the caller to determine that closed captions should not
be displayed anymore, in order to finish the previous cue earlier
than the start of the next cue.
First off, thanks for this library :)
gst-plugins-rs uses libcaption and has a test scc file for unit testing purposes. It applies to https://www.democracynow.org/shows/2018/12/17?autostart=true, and I find that both the gstreamer wrapper and the scc2srt executable generate empty cues and "offset-by-1" cue timestamps.
cat foo.scc
:scc2srt foo.scc
:Here, I believe:
The first scc cue should be ignored (simply clearing the screen)
The second cue should be timestamped as
00:00:14;01
+ the number of frames before0x94 0x2f
, as the cue starts by initiating pop-on mode (0x94 0x20
, "resume_caption_loading"). This seems to match pretty well with the actual media, as the lady starts saying "From New-York" some time during the 15th second.I suspect the last cue isn't drained, probably trivial to fix
From a quick look at the code, I think there are two issues at play here:
libcaption decides that frames are READY too often, for example when encountering
0x94 0x2c
(erase_display_memory) , this leads to the creation of a cue.caption_frame_decode
updates its timestamp before ignoring duplicate control commands, this explains the offset-by-1 issue, I believe this could be improved further by tracking the current mode, and in pop on mode updating the timestamp at the end of the caption instead of when the last call returned READY, this would however require making assumptions about the framerate (are SCC files always 29.97 fps?)The text was updated successfully, but these errors were encountered: