Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#6105 closed defect (fixed)

Closed captions not exported from mpeg2video

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: cc
Cc: lance.lmwang@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

http://ffmpeg.org/pipermail/ffmpeg-user/2017-January/035033.html
A user provided a transport stream that contains mpeg2video with Closed Captions that can be shown with vlc. Trying to export them results in an empty output file.

$ ffmpeg -i output.ts
ffmpeg version N-83255-gfca3083 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 45.100 / 55. 45.100
  libavcodec     57. 75.100 / 57. 75.100
  libavformat    57. 65.100 / 57. 65.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 71.100 /  6. 71.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mpegts, from 'output.ts':
  Duration: 00:05:00.26, start: 1.435089, bitrate: 3998 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], Closed Captions, 3463 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](tvj): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
At least one output file must be specified
$ ffmpeg -f lavfi -i "movie=out[out+subcc]" -map s out.srt
ffmpeg version N-83255-gfca3083 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 45.100 / 55. 45.100
  libavcodec     57. 75.100 / 57. 75.100
  libavformat    57. 65.100 / 57. 65.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 71.100 /  6. 71.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[mpegvideo @ 0x2515560] Estimating duration from bitrate, this may be inaccurate
Input #0, lavfi, from 'movie=out[out+subcc]':
  Duration: N/A, start: 0.100100, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480 [SAR 1:1 DAR 3:2], 29.97 fps, 29.97 tbr, 1200k tbn, 1200k tbc
    Stream #0:1: Subtitle: eia_608
Output #0, srt, to 'out.srt':
  Metadata:
    encoder         : Lavf57.65.100
    Stream #0:0: Subtitle: subrip (srt)
    Metadata:
      encoder         : Lavc57.75.100 srt
Stream mapping:
  Stream #0:1 -> #0:0 (eia_608 (cc_dec) -> subrip (srt))
Press [q] to stop, [?] for help
[mpeg2video @ 0x2517000] ac-tex damaged at 3 6peed=   0x
[mpeg2video @ 0x2517000] Warning MVs not available
[mpeg2video @ 0x2517000] concealing 1080 DC, 1080 AC, 1080 MV errors in P frame
size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Change History (14)

comment:2 by Elon Musk, 4 years ago

Resolution: invalid
Status: newclosed

The uploaded file have useless captions, all of data is multiplies of 0xFD 0x80 0x80.

comment:3 by Carl Eugen Hoyos, 4 years ago

Resolution: invalid
Status: closedreopened

They do not look useless to me...

comment:4 by Elon Musk, 4 years ago

Resolution: invalid
Status: reopenedclosed

Give proof and only then reopen ticket, otherwise you are evil.

comment:5 by Carl Eugen Hoyos, 4 years ago

Resolution: invalid
Status: closedreopened

While my Portuguese is a little rusty, the subtitles are clearly readable.

comment:6 by Elon Musk, 4 years ago

Resolution: invalid
Status: reopenedclosed

No proof provided, closing.

comment:7 by Elon Musk, 4 years ago

{{{./linux/ccextractor ~/Downloads/output.ts -o x.srt
CCExtractor 0.88, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc


Input: /home/computer/Downloads/output.ts
[Extract: 1] [Stream mode: Autodetect]
[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto]
[Timing mode: Auto] [Debug: No] [Buffer input: No]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: Yes] [Add font typesetting: Yes]
[Convert case: No][Filter profanity: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: No] [Clock frequency: 90000]
[Teletext page: Autodetect]
[Start credits text: None]
[Quantisation-mode: CCExtractor's internal function]


Opening file: /home/computer/Downloads/output.ts
File seems to be a transport stream, enabling TS mode
Analyzing data in general mode

New video information found
[720 * 480] [AR: 02 - 4:3] [FR: 04 - 29.97] [progressive: no]

100% | 04:59
Number of NAL_type_7: 0
Number of VCL_HRD: 0
Number of NAL HRD: 0
Number of jump-in-frames: 0
Number of num_unexpected_sei_length: 0

Total frames time: 00:04:59:932 (8989 frames at 29,97fps)
CC type 0: 0 (NTSC line 21 field 1 closed captions)
CC type 1: 0 (NTSC line 21 field 2 closed captions)
CC type 2: 0 (DTVCC Channel Packet Data)
CC type 3: 0 (DTVCC Channel Packet Start)

Min PTS: 00:00:01:700
Max PTS: 00:05:01:665
Length: 00:04:59:965

Initial GOP time: 03:08:57:734
Final GOP time: 03:13:57:300+10F
Diff. GOP length: 00:04:59:566+10F (00:04:59:899)

Number of key frames: 761
Total user data fields: 17978
HDTV type user data fields: 17978
Done, processing time = 3 seconds

No captions were found in input.
Issues? Open a ticket here}}}

comment:8 by Carl Eugen Hoyos, 4 years ago

Resolution: invalid
Status: closedreopened

comment:9 by Elon Musk, 4 years ago

Resolution: invalid
Status: reopenedclosed

How rude, very extremely rude.

comment:10 by Carl Eugen Hoyos, 4 years ago

Resolution: invalid
Status: closedreopened

comment:11 by Elon Musk, 4 years ago

Resolution: fixed
Status: reopenedclosed

comment:12 by Carl Eugen Hoyos, 4 years ago

Resolution: fixed
Status: closedreopened

comment:13 by Elon Musk, 4 years ago

Resolution: fixed
Status: reopenedclosed

comment:14 by lmwang, 4 years ago

Cc: lance.lmwang@gmail.com added
Component: undeterminedavcodec

should be fixed in 29ea4e1b3c511de0a406722bcfffa11604745451
I have submit one patch to fix the same issue before, but lack such cc sample for test and have no chance to push.
Now have push it after the change and test with same srt output, please refer to:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/1592746212-28284-1-git-send-email-lance.lmwang@gmail.com/

Please reopen it if test failed.

Note: See TracTickets for help on using tickets.