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

Roger Pack rogerdpack2 at gmail.com
Tue Apr 28 09:18:46 EEST 2020


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

...

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-closed-caption-decoder-add-new-parameter-to-allow-ou.patch
Type: application/octet-stream
Size: 4809 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200428/156bb7d0/attachment.obj>


More information about the ffmpeg-devel mailing list