Opened 2 years ago

Last modified 2 years ago

#9724 open defect

Duplicate character pairs in Closed Captions

Reported by: Selcuk Ozturk Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mpeg2video cc regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Bug in the handling of eia-608 closed captions. Captions have duplicated character pairs. The bug did not exist in ffmpeg versions 4.3.2 and earlier.

How to reproduce:
You will need a HDHomerun Prime and a cable service with cable card like Verizon FIOS or Comcast.

% ffmpeg -i http://192.168.78.45:5004/auto/v103 -c:v libx264 -preset:v ultrafast -g 29 -crf 40 -s 128x72 -bsf:v h264_mp4toannexb -map 0:v -f mpegts -t 60 z-4.4.1.ts
% ffmpeg -f lavfi -i movie=z-4.4.1.ts[out+subcc] z-4.4.1.srt

The resulting z-4.4.1.srt file has text like the following:


5
00:00:04,571 --> 00:00:10,410
<font face="Monospace">{\an7}ABABORORTITIONON T THAHATT I I
TETEXAXASS D DOEOESS H HAVAVEE E</font>

6
00:00:10,410 --> 00:00:11,845
<font face="Monospace">{\an7}TETEXAXASS D DOEOESS H HAVAVEE E
LALAWSWS T THAHATT A ARERE P PUT</font>


Using the old releases available on https://johnvansickle.com/ffmpeg/ site, I have narrowed down the introduction of the bug somewhere between ffmpeg versions 4.3.2 and 4.4.1. All versions up to and including 4.3.2 are working properly and producing correct closed captions. All versions from 4.4.1 on have this bug.

The problem is at the recording of the TS file and not at the extraction of SRT file. Playing the resulting TS file in VLC demonstrates the problem in closed captions.

I can provide both the recorded TS files and the SRT files if needed.

Attachments (4)

v-4.4.1.ts (719.3 KB ) - added by Selcuk Ozturk 2 years ago.
TS recording with ffmpeg v4.4.1
v-4.4.1.srt (3.9 KB ) - added by Selcuk Ozturk 2 years ago.
SRT file with version 4.4.1
v-4.3.2.ts (686.1 KB ) - added by Selcuk Ozturk 2 years ago.
TS recording with ffmpeg v4.3.2
v-4.3.2.srt (4.1 KB ) - added by Selcuk Ozturk 2 years ago.
SRT file with version 4.3.2

Download all attachments as: .zip

Change History (17)

comment:1 by Balling, 2 years ago

I can provide both the recorded TS files and the SRT files if needed

Please do.

by Selcuk Ozturk, 2 years ago

Attachment: v-4.4.1.ts added

TS recording with ffmpeg v4.4.1

by Selcuk Ozturk, 2 years ago

Attachment: v-4.4.1.srt added

SRT file with version 4.4.1

by Selcuk Ozturk, 2 years ago

Attachment: v-4.3.2.ts added

TS recording with ffmpeg v4.3.2

by Selcuk Ozturk, 2 years ago

Attachment: v-4.3.2.srt added

SRT file with version 4.3.2

comment:2 by Elon Musk, 2 years ago

Provide input file, output files are waste of space.

in reply to:  2 comment:3 by Selcuk Ozturk, 2 years ago

Replying to Elon Musk:

Provide input file, output files are waste of space.

There is no input file. The input is a live stream from a HDHomerun as visible in the first command -i http://192.168.78.45:5004/auto/v103.

However, the .ts files are inputs to the second command.

comment:4 by Elon Musk, 2 years ago

I tried first ts file and 2nd command and srt output is ok. used latest git version of ffmpeg

in reply to:  4 comment:5 by Selcuk Ozturk, 2 years ago

Replying to Elon Musk:

I tried first ts file and 2nd command and srt output is ok. used latest git version of ffmpeg

v4.3.2.ts produces good SRT file. v4.4.1.ts creates the duplicate character pairs. If you play both .ts files in VLC with closed captions on, you see good captions with the 4.3.2 file and bad ones with 4.4.1.

comment:6 by mkver, 2 years ago

You need to record said livestream. (You may try "-map 0 -c copy" and see whether the issue is reproducible with the output; or you can use "-f data -i http://192.168.78.45:5004/auto/v103 -map 0 -c copy -f data out.ts".)
(The issue in v-4.4.1.ts​ exists regardless of whether I use git master or release 4.3; similarly v-4.3.2.ts is fine regardless of whether I use git master or 4.3.)

in reply to:  6 comment:7 by Selcuk Ozturk, 2 years ago

Replying to mkver:

You need to record said livestream. (You may try "-map 0 -c copy" and see whether the issue is reproducible with the output; or you can use "-f data -i http://192.168.78.45:5004/auto/v103 -map 0 -c copy -f data out.ts".)
(The issue in v-4.4.1.ts​ exists regardless of whether I use git master or release 4.3; similarly v-4.3.2.ts is fine regardless of whether I use git master or 4.3.)

I have produced an out.ts file using "ffmpeg -f data -i ​http://192.168.78.45:5004/auto/v103 -map 0 -c copy -f data out.ts". The issue is reproducible using this out.ts file as input to the first command instead of the live stream. The out.ts file is 23MB. How and where do I upload it?

comment:8 by mkver, 2 years ago

Upload it here; select FFmpeg and the number of this issue (9724).

comment:9 by Selcuk Ozturk, 2 years ago

Uploaded the out.ts file which can be used to reproduce this issue.

comment:10 by mkver, 2 years ago

Files are here.

comment:12 by Carl Eugen Hoyos, 2 years ago

Component: ffmpegavcodec
Keywords: cc regression added; eia_608 closed captions removed
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: 4.4.1git-master

Regression since 29ea4e1b3c511de0a406722bcfffa11604745451, related to ticket #6105

comment:13 by Carl Eugen Hoyos, 2 years ago

Keywords: mpeg2video added
Note: See TracTickets for help on using tickets.