Opened 13 years ago

Closed 12 years ago

#379 closed defect (fixed)

pgssub -> dvdsub in matroska

Reported by: Thomas Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: pgssub dvdsub mkv
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

My cam creates mpeg-ts files with h264+ac3+pgs tracks. I need to convert the container and the subtitle track to matroska and vobsub.
I use this command :
ffmpeg -i file.mts -vcodec copy -acodec copy -scodec dvdsub file.mkv

It works but the vobsub track is not CodecPrivate so I can't use it with mkvtoolnix.
I think this is a bug. Sorry for the ticket if it's not.

Change History (5)

comment:1 by Aurélien Jacobs, 13 years ago

I just tried with latest ffmpeg and sample [1]. It stops with the following message:

Subtitle encoding failed

With an old version (0.6.something) it works, and indeed, it doesn't generate extradata.
I guess it is either the pgssub decoder or dvdsub encoder which doesn't decode or
encode extradata, but it requires a deeper analysis.

[1] http://samples.mplayerhq.hu/sub/BluRay/sample-dts-not-valid-dca-frame.m2ts

comment:2 by reimar, 13 years ago

The "Subtitle encoding failed" is due to the decode PGS packets that do not contain any rects, the dvdsub encoder cannot handle them.
If you change the condition to return 0 it will continue to encode, though I don't know if the result is usable/playable.

comment:3 by Carl Eugen Hoyos, 12 years ago

Keywords: pgssub added; vobsub dvdsub matroska removed
Priority: importantnormal
Reproduced by developer: set
Status: newopen
Summary: vobsub track without CodecPrivateRemuxing pgssub in matroska
Version: 0.8.1git-master

mkvalidator does not like ffmpeg's output:

$ ffmpeg -i sample-dts-not-valid-dca-frame.m2ts -vcodec copy -acodec copy -scodec copy out.mkv
ffmpeg version N-47403-g7e93b0b Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  3 2012 11:57:16 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack --disable-yasm --disable-asm
  libavutil      52. 11.101 / 52. 11.101
  libavcodec     54. 78.101 / 54. 78.101
  libavformat    54. 42.100 / 54. 42.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 23.105 /  3. 23.105
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.101 /  0. 17.101
  libpostproc    52.  2.100 / 52.  2.100
[dca @ 0x17365c0] Not a valid DCA frame
    Last message repeated 52 times
[mpegts @ 0x168a150] Stream #5: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #6: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #7: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #8: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #9: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #10: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #11: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #12: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #13: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #14: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #15: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #16: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #17: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #18: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #19: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #20: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Stream #21: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x168a150] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 9 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 10 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 11 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 12 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 13 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 14 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 15 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 16 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 17 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 18 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 19 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 20 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] Could not find codec parameters for stream 21 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x168a150] decoding for stream 22 failed
[mpegts @ 0x168a150] Could not find codec parameters for stream 22 (Audio: dts ([162][0][0][0] / 0x00A2), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x1690730] start time is not set in estimate_timings_from_pts
[NULL @ 0x1690f60] start time is not set in estimate_timings_from_pts
[NULL @ 0x16917e0] start time is not set in estimate_timings_from_pts
[NULL @ 0x1691fd0] start time is not set in estimate_timings_from_pts
[NULL @ 0x16e59b0] start time is not set in estimate_timings_from_pts
[NULL @ 0x16ebcc0] start time is not set in estimate_timings_from_pts
[NULL @ 0x16f2040] start time is not set in estimate_timings_from_pts
[NULL @ 0x16f8350] start time is not set in estimate_timings_from_pts
[NULL @ 0x16fe6e0] start time is not set in estimate_timings_from_pts
[NULL @ 0x17049f0] start time is not set in estimate_timings_from_pts
[NULL @ 0x170ade0] start time is not set in estimate_timings_from_pts
[NULL @ 0x17110f0] start time is not set in estimate_timings_from_pts
[NULL @ 0x17174a0] start time is not set in estimate_timings_from_pts
[NULL @ 0x171d7b0] start time is not set in estimate_timings_from_pts
[NULL @ 0x1723bd0] start time is not set in estimate_timings_from_pts
[NULL @ 0x1729ee0] start time is not set in estimate_timings_from_pts
[NULL @ 0x17302b0] start time is not set in estimate_timings_from_pts
[mpegts @ 0x168a150] PES packet size mismatch
    Last message repeated 3 times
Input #0, mpegts, from 'sample-dts-not-valid-dca-frame.m2ts':
  Duration: 00:00:53.18, start: 11.608967, bitrate: 16276 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Stream #0:2[0x1101]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 448 kb/s
    Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 448 kb/s
    Stream #0:4[0x1103]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 448 kb/s
    Stream #0:5[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:6[0x1201]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:7[0x1202]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:8[0x1203]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:9[0x1204]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:10[0x1205]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:11[0x1206]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:12[0x1207]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:13[0x1208]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:14[0x1209]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:15[0x120a]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:16[0x120b]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:17[0x120c]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:18[0x120d]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:19[0x120e]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:20[0x120f]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:21[0x1210]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:22[0x1a00]: Audio: dts ([162][0][0][0] / 0x00A2), 0 channels, fltp
    Stream #0:23[0x1b00]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 720x480 [SAR 40:33 DAR 20:11], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf54.42.100
    Stream #0:0: Video: h264 (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 90k tbc
    Stream #0:1: Audio: dts ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), 1536 kb/s
    Stream #0:2: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:5 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x168a150] PES packet size mismatch
frame= 1273 fps=0.0 q=-1.0 Lsize=   88047kB time=00:00:53.05 bitrate=13595.5kbits/s
video:70275kB audio:17585kB subtitle:134 global headers:0kB muxing overhead 0.059732%
$ mkvalidator out.mkv
ERR0B1: Block at 50661520 track #3 is not a keyframe
ERR0B1: Block at 50661553 track #3 is not a keyframe
ERR0B1: Block at 50661578 track #3 is not a keyframe
ERR0B1: Block at 50661917 track #3 is not a keyframe
ERR0B1: Block at 50707127 track #3 is not a keyframe
ERR0B1: Block at 56486707 track #3 is not a keyframe
ERR0B1: Block at 56486732 track #3 is not a keyframe
ERR0B1: Block at 56486756 track #3 is not a keyframe
ERR0B1: Block at 58281775 track #3 is not a keyframe
ERR0B1: Block at 58281808 track #3 is not a keyframe
ERR0B1: Block at 58281833 track #3 is not a keyframe
ERR0B1: Block at 58282172 track #3 is not a keyframe
ERR0B1: Block at 58322632 track #3 is not a keyframe
ERR0B1: Block at 70426654 track #3 is not a keyframe
ERR0B1: Block at 70426679 track #3 is not a keyframe
ERR0B1: Block at 70426703 track #3 is not a keyframe
ERR0B1: Block at 70946184 track #3 is not a keyframe
ERR0B1: Block at 70946217 track #3 is not a keyframe
ERR0B1: Block at 70946242 track #3 is not a keyframe
ERR0B1: Block at 70946581 track #3 is not a keyframe
ERR0B1: Block at 70974021 track #3 is not a keyframe
ERR0B1: Block at 82469195 track #3 is not a keyframe
ERR0B1: Block at 82469220 track #3 is not a keyframe
ERR0B1: Block at 82469244 track #3 is not a keyframe
ERR0B1: Block at 85421140 track #3 is not a keyframe
ERR0B1: Block at 85421173 track #3 is not a keyframe
ERR0B1: Block at 85421198 track #3 is not a keyframe
ERR0B1: Block at 85421537 track #3 is not a keyframe
ERR0B1: Block at 85461724 track #3 is not a keyframe
....    file created with Lavf54.42.100 / Lavf54.42.100

comment:4 by Cigaes, 12 years ago

Can you post an excerpt of the output of ffprobe -show_packets on your input file showing the paragraph for a few subtitles packets.

My guess is that the duration field is not set.

comment:5 by Carl Eugen Hoyos, 12 years ago

Keywords: dvdsub added
Resolution: fixed
Status: openclosed
Summary: Remuxing pgssub in matroskapgssub -> dvdsub in matroska

I misread the original description last week;-(
Reencoding pgssub -> dvdsub in matroska works fine with current git head (and mkvalidator accepts the output file), fails with earlier versions either completely or leads to slightly broken subtitles.

I opened ticket #2023 for the problem with mkvalidator on remuxing (the duration field is indeed not set), sorry for the mess!

Note: See TracTickets for help on using tickets.