[FFmpeg-devel] [PATCH 2/3] closed caption decoder: add new parameter to allow output to avoid repeated lines

Hendrik Leppkes h.leppkes at gmail.com
Tue Apr 28 10:13:58 EEST 2020


On Tue, Apr 28, 2020 at 8:19 AM Roger Pack <rogerdpack2 at gmail.com> wrote:
>
> I didn't actually *need* this but thought the functionality was very
> nice to have, so here's my contribution.
>
> It allows for forcing "rollup" style closed captions to output one
> line at a time (basically, when there is a carriage return, it outputs
> a line), so there is never any duplication in the output, for instance
> if it's converted to .srt or .vtt files.  Without this you have output
> like this:
>
>
> 00:01.536 --> 00:03.605
> AND AS A SECONDARY QUESTION, I
>
> 00:03.605 --> 00:05.707
> AND AS A SECONDARY QUESTION, I
> WOULD ASK YOU HOW OUR VETERANS
>
> 00:05.706 --> 00:09.343
> WOULD ASK YOU HOW OUR VETERANS
> AND ACTIVE DUTY MILITARY HAVE
>
> 00:09.344 --> 00:10.412
> AND ACTIVE DUTY MILITARY HAVE
> FARED UNDER THIS COMMANDER IN
>
> With it set to "1" you get output like this:
>
>
> 00:02.014 --> 00:03.049
> SOLDIERS HOME IN HOLYOKE,
>
> 00:03.048 --> 00:04.116
> MASSACHUSETTS, HAVE LOST 73.
>
> 00:04.116 --> 00:04.850
> ANOTHER FACILITY IN NEW ORLEANS,
>
> 00:04.850 --> 00:06.184
> 53.
>
> 00:06.184 --> 00:07.753
> VETERANS ARE IN REAL PERIL
>
> 00:07.753 --> 00:14.193
> BECAUSE OF A LACK OF PREPARATION
>
> 00:14.193 --> 00:15.727
> AND THEN THE SAME DYSFUNCTION
>

I would've figured that even when you split it into  individual lines,
that each line would show for the same amount as it did before, ie.
with overlap in the SRT. Otherwise, some lines like the "ANOTHER
FACILITY IN NEW ORLEANS," one are shown for not even a second, which
seems pretty bad.

- Hendrik


More information about the ffmpeg-devel mailing list