Opened 4 weeks ago

Last modified 3 weeks ago

#7506 new defect

EIA-608 Closed Captions distortion on the output.

Reported by: w_boba Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: EIA-608, a53cc, closed captions
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffmpeg.exe -y -v 99 -loglevel 99 -i sample-1min.ts -c:a aac -c:v libx264 sample-1min.mp4
ffmpeg version N-92202-gf72b9904fe Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181017
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.101 / 58. 33.101
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100

When I try to re-encode some MPEG2 TS files into h.264/mp4 using libx264 for encoder, embedded closed captions are not properly passed through to output file. It looks to me like CCs are doubled for some reason.

Original CCs (got them with CCextractor tool) look like this:

1
00:00:01,751 --> 00:00:03,469
        Yup, so you just
       want a nice layer.

2
00:00:03,536 --> 00:00:04,670
       That's good there.

3
00:00:04,721 --> 00:00:06,305
      Potatoes are ready.

4
00:00:06,372 --> 00:00:08,090
  This gets covered in
 your famous pot crack?

While extracted from MP4 file after re-encoding - they look like this:

1
00:00:01,234 --> 00:00:03,034
   So we'e're makaking B.C. h h?

2
00:00:03,036 --> 00:00:04,703
        YuYup, so you u just
       want a  nice layerer.

3
00:00:04,871 --> 00:00:06,004
       That''s goodod there.

4
00:00:06,105 --> 00:00:07,672
      Potatoes a are ready..

Attachments (3)

sample-1min-stderr.log (411.4 KB) - added by w_boba 4 weeks ago.
FFmpeg debug log
sample-1min-ts.srt (2.9 KB) - added by w_boba 4 weeks ago.
CCs from original file
sample-1min-mp4.srt (2.9 KB) - added by w_boba 4 weeks ago.
CCs from output file

Download all attachments as: .zip

Change History (5)

Changed 4 weeks ago by w_boba

FFmpeg debug log

Changed 4 weeks ago by w_boba

CCs from original file

Changed 4 weeks ago by w_boba

CCs from output file

comment:1 Changed 4 weeks ago by w_boba

All files required to reproduce this issue can be downloaded from here:
(240MB) http://64.137.230.232/cc-distortion.zip

comment:2 Changed 3 weeks ago by The_Bart_The

I recently found out FFMPEG preserves closed caption data by default and am currently in the process of switching my scripts over from HandBrakeCLI. I also discovered this, searched for this bug online and found this post the same day it went up.

Anyway, I'm getting this same bug when I convert an NBC broadcast (captured via antenna, so ATSC 1080i MPEG-2 TS; specifically from WMAQ in Chicago) but I haven't seen this bug yet from CBS (WBBM, 1080i), FOX (WFLD, 720p) PBS (WTTW, 1080i), CW (WPWR, 720p) or ABC (WLS, 720p).

I've only been using FFMPEG seriously for a few days, so I'll report back with any new relevant information. (Maybe it's only certain shows instead of networks; who knows?)

Note: See TracTickets for help on using tickets.