Repository navigation
Conversation
flush_cc_decode() only flushes the 608 decoders for a fixed list of output formats, and -out=g608 and -out=simple-xml are not in it, even though both go through process608 and write_cc_buffer. A caption that is still on screen when the input ends was never written in those two formats, while srt, webvtt, sami etc. write it with the end time at the end of the stream. Add both formats to the two flush lists.
CCExtractor CI platform finished running the test files on linux. 172/238 tests matched the approved output:
66 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 9984, commit 24d1e0a:
Compared with the commit this branch was cut from: the same run as the tip of master (test 9984), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
CCExtractor CI platform finished running the test files on windows. 172/238 tests matched the approved output:
66 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 9985, commit 24d1e0a:
Compared with the commit this branch was cut from: the same run as the tip of master (test 9985), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
Sample (attached,
last_caption_on_screen.scc): two pop-on captions, "First" at 00:00:01:00 and "Second" at 00:00:03:00. "Second" is never erased before the file ends (the last line at 00:00:06:00 is only padding).On master, srt (and webvtt, sami, smptett, ssa, txt, ...) has both captions, "Second" ending at 00:00:06,699. g608 and simple-xml only have "First":
It is not specific to SCC input. Same result with the .bin written by
-out=binfrom that file, and with a MOV that has the captions in a c608 track (ffmpeg -f lavfi -i color=black:s=160x120:r=30000/1001:d=8 -i last_caption_on_screen.scc -map 0:v -map 1:s -c:v mpeg4 -c:s copy sample.mov).flush_cc_decode() only calls flush_608_context() for a fixed list of output formats. G608 and SIMPLE_XML use process608 like the others, but they are not in that list, so whatever is still on screen at the end of the input is dropped for those two formats. This adds them to both lists (field 1 and field 2).
Testing: built with linux/build and ran the old and new binary on the sample above (SCC, BIN and MOV versions) with srt, webvtt, sami, ssa, ttxt, txt, smptett, scc, ccd, g608, simple-xml, mcc and bin output, plus two SCC files whose last caption is erased before EOF and a teletext TS. The only differences are in g608 and simple-xml for the three inputs where a caption is still on screen at the end, where "Second" is now written (g608 gets the same 00:00:03,001 --> 00:00:06,699 as srt). Nothing changes for files that end with an empty screen, so no caption is written twice.