Opened 12 years ago

Closed 5 years ago

#2622 closed defect (fixed)

Subtitle (hdmv pgs) remux fails

Reported by: skifreak Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: pgssub mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:ffmpeg fails when remuxing hdmv pgs subtitles

How to reproduce:ffmpeg -i hdmv_pgs_subtitle_remux_fail.m2ts -map 0 -c copy out.m2ts

ffmpeg version: git-master
June 1, 2013
Files are available on the ftp under incoming/hdmv_pgs_subtitle_remux_fail.tgz

Attempted to run
skifreak@LedBox ~/Documents/x264 Encoding/hdmv_pgs_subtitle_remux_fail $ ffmpeg -i hdmv_pgs_subtitle_remux_fail.m2ts -map 0 -c copy /tmp/test.m2tsffmpeg version N-53758-g5711e4f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun  1 2013 18:59:50 with gcc 4.5.4 (Gentoo 4.5.4 p1.1, pie-0.4.7)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe -g' --extra-cflags='-march=native -O2 -pipe -g' --extra-cxxflags='-march=native -O2 -pipe -g' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-version3 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-version3 --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --disable-network --disable-openssl --enable-ffplay --disable-vaapi --disable-vdpau --enable-zlib --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libmp3lame --disable-libfdk-aac --disable-libaacplus --disable-libfaac --enable-libtheora --disable-libtwolame --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --enable-libdc1394 -  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 13.100 / 55. 13.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 74.101 /  3. 74.101
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mpegts @ 0x25698a0] Stream #3: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x25698a0] Stream #4: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x25698a0] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x25698a0] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x256f780] start time is not set in estimate_timings_from_pts
[NULL @ 0x25701c0] start time is not set in estimate_timings_from_pts
[mpegts @ 0x25698a0] PES packet size mismatch
Input #0, mpegts, from 'hdmv_pgs_subtitle_remux_fail.m2ts':
  Duration: 00:00:05.22, start: 65.986667, bitrate: 23524 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: vc1 (VC-1 / 0x312D4356), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100]: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz, 5.1(side), s16, 4608 kb/s
    Stream #0:2[0x1101]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:3[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:4[0x1201]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
File '/tmp/test.m2ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to '/tmp/test.m2ts':
  Metadata:
    encoder         : Lavf55.8.102
    Stream #0:0: Video: vc1 (VC-1 / 0x312D4356), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 90k tbn, 23.98 tbc
    Stream #0:1: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz, 5.1(side), 4608 kb/s
    Stream #0:2: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), 640 kb/s
    Stream #0:3: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:4: 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:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x2570f20] Application provided invalid, non monotonically increasing dts to muxer in stream 3: 458492 >= 458492
av_interleaved_write_frame(): Invalid argument


skifreak@LedBox ~/Documents/x264 Encoding/hdmv_pgs_subtitle_remux_fail $ ffmpeg -v 9 -loglevel 99 -i hdmv_pgs_subtitle_remux_fail.m2ts 
ffmpeg version N-53758-g5711e4f Copyright (c) 2000-2013 the FFmpeg developers                                                                                      
  built on Jun  1 2013 18:59:50 with gcc 4.5.4 (Gentoo 4.5.4 p1.1, pie-0.4.7)                                                                                      
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe -g' --extra-cflags='-march=native -O2 -pipe -g' --extra-cxxflags='-march=native -O2 -pipe -g' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-version3 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-version3 --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --disable-network --disable-openssl --enable-ffplay --disable-vaapi --disable-vdpau --enable-zlib --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libmp3lame --disable-libfdk-aac --disable-libaacplus --disable-libfaac --enable-libtheora --disable-libtwolame --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --enable-libdc1394 -  libavutil      52. 34.100 / 52. 34.100                                                                              
  libavcodec     55. 13.100 / 55. 13.100                                                                                                                           
  libavformat    55.  8.102 / 55.  8.102                                                                                                                           
  libavdevice    55.  2.100 / 55.  2.100                                                                                                                           
  libavfilter     3. 74.101 /  3. 74.101
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.                                                                               
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.                                                                
Reading option '-i' ... matched as input file with argument 'hdmv_pgs_subtitle_remux_fail.m2ts'.                                                                   
Finished splitting the commandline.                                                                                                                                
Parsing a group of options: global .                                                                                                                               
Applying option v (set logging level) with argument 9.                                                                                                             
Successfully parsed a group of options.                                                                                                                            
Parsing a group of options: input file hdmv_pgs_subtitle_remux_fail.m2ts.                                                                                          
Successfully parsed a group of options.                                                                                                                            
Opening an input file: hdmv_pgs_subtitle_remux_fail.m2ts.                                                                                                          
[mpegts @ 0x12b3080] Format mpegts probed with size=2048 and score=100                                                                                             
[mpegts @ 0x12b3080] stream=0 stream_type=ea pid=1011 prog_reg_desc=HDMV                                                                                           
[mpegts @ 0x12b3080] stream=1 stream_type=80 pid=1100 prog_reg_desc=HDMV                                                                                           
[mpegts @ 0x12b3080] stream=2 stream_type=81 pid=1101 prog_reg_desc=HDMV                                                                                           
[mpegts @ 0x12b3080] stream=3 stream_type=90 pid=1200 prog_reg_desc=HDMV                                                                                           
[mpegts @ 0x12b3080] stream=4 stream_type=90 pid=1201 prog_reg_desc=HDMV                                                                                           
[mpegts @ 0x12b3080] File position before avformat_find_stream_info() is 0                                                                                         
[mpegts @ 0x12b3080] parser not found for codec pcm_bluray, packets or times may be invalid.                                                                       
[mpegts @ 0x12b3080] parser not found for codec hdmv_pgs_subtitle, packets or times may be invalid.                                                                
    Last message repeated 1 times
[mpegts @ 0x12b3080] parser not found for codec pcm_bluray, packets or times may be invalid.
[NULL @ 0x12b7160] Header: DBFE3BF2                                                                                                                                
[NULL @ 0x12b7160] Advanced Profile level 3:                                                                                                                       
frmrtq_postproc=7, bitrtq_postproc=31                                                                                                                              
LoopFilter=0, ChromaFormat=1, Pulldown=1, Interlace: 0                                                                                                             
TFCTRflag=0, FINTERPflag=0                                                                                                                                         
[NULL @ 0x12b7160] Display extended info:                                                                                                                          
[NULL @ 0x12b7160] Display dimensions: 1920x1080                                                                                                                   
[NULL @ 0x12b7160] Aspect: 1:1                                                                                                                                     
[NULL @ 0x12b7160] Entry point: 1ADFFCEF                                                                                                                           
[NULL @ 0x12b7160] Entry point info:                                                                                                                               
BrokenLink=0, ClosedEntry=0, PanscanFlag=0                                                                                                                         
RefDist=1, Postproc=1, FastUVMC=0, ExtMV=1                                                                                                                         
DQuant=1, VSTransform=1, Overlap=0, Qmode=3                                                                                                                        
[NULL @ 0x12b7160] Header: DBFE3BF2                                                                                                                                
[NULL @ 0x12b7160] Advanced Profile level 3:                                                                                                                       
frmrtq_postproc=7, bitrtq_postproc=31                                                                                                                              
LoopFilter=1, ChromaFormat=1, Pulldown=1, Interlace: 0                                                                                                             
TFCTRflag=0, FINTERPflag=0                                                                                                                                         
[NULL @ 0x12b7160] Display extended info:                                                                                                                          
[NULL @ 0x12b7160] Display dimensions: 1920x1080                                                                                                                   
[NULL @ 0x12b7160] Aspect: 1:1                                                                                                                                     
[NULL @ 0x12b7160] Entry point: 1ADFFCEF                                                                                                                           
[NULL @ 0x12b7160] Entry point info:                                                                                                                               
BrokenLink=0, ClosedEntry=0, PanscanFlag=0                                                                                                                         
RefDist=1, Postproc=1, FastUVMC=0, ExtMV=1                                                                                                                         
DQuant=1, VSTransform=1, Overlap=0, Qmode=3                                                                                                                        
[NULL @ 0x12b7160] Header: DBFE3BF2                                                                                                                                
[NULL @ 0x12b7160] Advanced Profile level 3:                                                                                                                       
frmrtq_postproc=7, bitrtq_postproc=31                                                                                                                              
LoopFilter=1, ChromaFormat=1, Pulldown=1, Interlace: 0                                                                                                             
TFCTRflag=0, FINTERPflag=0                                                                                                                                         
[NULL @ 0x12b7160] Display extended info:                                                                                                                          
[NULL @ 0x12b7160] Display dimensions: 1920x1080                                                                                                                   
[NULL @ 0x12b7160] Aspect: 1:1                                                                                                                                     
[NULL @ 0x12b7160] Entry point: 1ADFFCEF                                                                                                                           
[NULL @ 0x12b7160] Entry point info:                                                                                                                               
BrokenLink=0, ClosedEntry=0, PanscanFlag=0                                                                                                                         
RefDist=1, Postproc=1, FastUVMC=0, ExtMV=1                                                                                                                         
DQuant=1, VSTransform=1, Overlap=0, Qmode=3                                                                                                                        
[mpegts @ 0x12b3080] Probe buffer size limit of 5000000 bytes reached                                                                                              
[mpegts @ 0x12b3080] Stream #3: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x12b3080] Stream #4: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x12b3080] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x12b3080] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x12b9020] start time is not set in estimate_timings_from_pts
[NULL @ 0x12b9a60] start time is not set in estimate_timings_from_pts
[mpegts @ 0x12b3080] PES packet size mismatch
[mpegts @ 0x12b3080] File position after avformat_find_stream_info() is 0
Input #0, mpegts, from 'hdmv_pgs_subtitle_remux_fail.m2ts':
  Duration: 00:00:05.22, start: 65.986667, bitrate: 23524 kb/s
  Program 1 
    Stream #0:0[0x1011], 37, 1/90000: Video: vc1 (VC-1 / 0x312D4356), 1920x1080 [SAR 1:1 DAR 16:9], 1001/48000, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100], 325, 1/90000: Audio: pcm_bluray (HDMV / 0x564D4448), 48000 Hz, 5.1(side), s16, 4608 kb/s
    Stream #0:2[0x1101], 50, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Stream #0:3[0x1200], 0, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Stream #0:4[0x1201], 0, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0x12bb7a0] Statistics: 5984400 bytes read, 3 seeks

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (12)

comment:1 by Carl Eugen Hoyos, 12 years ago

Component: FFmpegavformat
Keywords: pgssub mpegts added; hdmv_pgs subtitle removed
Status: newopen

comment:2 by Starbuck, 10 years ago

Not due particularly to pgssub , will not work with dvdsub because it comes from -f mpegts .m2ts, do same with -f matroska .mkv and it will work.

comment:4 by Carl Eugen Hoyos, 9 years ago

The same fix will hopefully address pcm_bluray remuxing.

comment:5 by Djfe, 8 years ago

Just out of curiosity: is this bug still being worked on?

comment:6 by hackler756, 6 years ago

bump - hdmv_pgs_subtitle copy stream support

  • decoder is here: libavcodec / pgssubdec.c
  • headers are missing - see partial patch
  • encoder is missing - stream copy support would be enough due to format

also referenced here #7360

comment:7 by Samuel, 6 years ago

Also if this same command line didn't gave the same result with my samples using a recent FFmpeg version, it copy the PGS stream as data stream, so subtitle are unplayable.

Perhaps that a patch similar to the Carl patch done recently for DVBSUB will solve that?
https://patchwork.ffmpeg.org/patch/11186/

Last edited 6 years ago by Samuel (previous) (diff)

comment:8 by Anton Torp, 6 years ago

Hi,

See more info in ticket #7842.

comment:9 by Andrew-R, 5 years ago

There is also https://github.com/justdan96/tsMuxer , in theory it might work (remux) with those subtitles, but I haven't tried this yet.

comment:10 by Andrew-R, 5 years ago

tried tsMuxer. it can remux PGS subtitles from MKV (for example from sample from comment №11 at https://trac.videolan.org/vlc/ticket/6324) into something xine/mplayer recognize as BD disk.

tsMuxer require either config file per run, or GUI (but I don't have qt5, so I just used command line)
My two attempts at using it at https://yadi.sk/d/_LYvNL4N0aSZuA

Mplayer may require -demuxer mpegts and/or "-lavdopts wait_keyframe" (from https://lists.mplayerhq.hu/pipermail/mplayer-users/2014-March/087262.html). May be my examples just too short for seeking working correctly by default?

comment:12 by Carl Eugen Hoyos, 5 years ago

Resolution: fixed
Status: openclosed

Fixed by Marton Balint in 7f2649bb46e3dde691edfb03aeb42ba4ef183ab8

Note: See TracTickets for help on using tickets.