id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
2024	Reencoding dvbsub fails	cehoyos		"I tested two samples:
http://samples.ffmpeg.org/MPEG-VOB/ClosedCaptions/Starship_Troopers.vob
http://samples.ffmpeg.org/MPEG-VOB/transport/dvbsub/dvbsubtest.ts
and tried to reencode them to dvbsub. This works fine for the dvdsub sample, but fails for the dvbsub (input) sample.
{{{
$ ffmpeg -i dvbsubtest.ts -qscale 2 -mbd 2 -scodec dvbsub out.ts
ffmpeg version N-47774-g26db653 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 12 2012 21:57:33 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 79.102 / 54. 79.102
  libavformat    54. 49.101 / 54. 49.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 26.102 /  3. 26.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x2f23280] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x2f23280] PES packet size mismatch
Input #0, mpegts, from 'dvbsubtest.ts':
  Duration: 00:00:34.60, start: 79677.098467, bitrate: 4848 kb/s
  Program 1
    Stream #0:0[0x1901](eng): Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x19a1](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x19b1](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf54.49.101
    Stream #0:0(eng): Video: mpeg2video (hq), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
    Stream #0:2(eng): Subtitle: dvb_subtitle
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
  Stream #0:1 -> #0:1 (mp2 -> mp2)
  Stream #0:2 -> #0:2 (dvbsub -> dvbsub)
Press [q] to stop, [?] for help
frame=  310 fps=0.0 q=2.0 size=       0kB time=00:00:12.32 bitrate=   0.0kbits/s dup=10 drop=0Application provided invalid, non monotonically increasing dts to muxer in stream 2: 3005830 >= 1670230
av_interleaved_write_frame(): Invalid argument
}}}
Remuxing all strams fails (remuxing only audio and video works fine):
{{{
$ ffmpeg -i dvbsubtest.ts -acodec copy -vcodec copy -scodec dvbsub out.ts
ffmpeg version N-47774-g26db653 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 12 2012 21:57:33 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 79.102 / 54. 79.102
  libavformat    54. 49.101 / 54. 49.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 26.102 /  3. 26.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x1b92280] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x1b92280] PES packet size mismatch
Input #0, mpegts, from 'dvbsubtest.ts':
  Duration: 00:00:34.60, start: 79677.098467, bitrate: 4848 kb/s
  Program 1
    Stream #0:0[0x1901](eng): Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x19a1](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x19b1](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf54.49.101
    Stream #0:0(eng): Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
    Stream #0:1(eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, 256 kb/s
    Stream #0:2(eng): Subtitle: dvb_subtitle
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (dvbsub -> dvbsub)
Press [q] to stop, [?] for help
[mpegts @ 0x1b9a2e0] Application provided invalid, non monotonically increasing dts to muxer in stream 2: 3005830 >= 1670230
av_interleaved_write_frame(): Invalid argument
}}}
Remuxing only the subtitles work, but the resulting file shows no subtitles:
{{{
$ ffmpeg -i dvbsubtest.ts -qscale 2 -mbd 2 -scodec copy out.ts
ffmpeg version N-47774-g26db653 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 12 2012 21:57:33 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 79.102 / 54. 79.102
  libavformat    54. 49.101 / 54. 49.101
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 26.102 /  3. 26.102
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x2ae8280] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x2ae8280] PES packet size mismatch
Input #0, mpegts, from 'dvbsubtest.ts':
  Duration: 00:00:34.60, start: 79677.098467, bitrate: 4848 kb/s
  Program 1
    Stream #0:0[0x1901](eng): Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x19a1](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x19b1](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf54.49.101
    Stream #0:0(eng): Video: mpeg2video (hq), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s
    Stream #0:2(eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
  Stream #0:1 -> #0:1 (mp2 -> mp2)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=  311 fps=0.0 q=2.0 size=    5961kB time=00:00:13.09 bitrate=3728.0kbits/s dup=10 drop=0frame=  570 fps=569 q=2.0 size=   14614kB time=00:00:23.13 bitrate=5173.9kbits/s dup=10 drop=0frame=  821 fps=546 q=2.0 size=   25327kB time=00:00:32.76 bitrate=6333.3kbits/s dup=10 drop=0PES packet size mismatch
[mpeg2video @ 0x2aec140] invalid mb type in P Frame at 43 16
[mpeg2video @ 0x2aec140] Warning MVs not available
[mpeg2video @ 0x2aec140] concealing 900 DC, 900 AC, 900 MV errors in P frame
[mp2 @ 0x2aecc20] incomplete frame
Error while decoding stream #0:1: Invalid data found when processing input
frame=  866 fps=538 q=2.0 Lsize=   28381kB time=00:00:34.67 bitrate=6704.4kbits/s dup=12 drop=0
video:25613kB audio:535kB subtitle:50 global headers:0kB muxing overhead 8.332572%
}}}"	defect	new	normal	undetermined	git-master		dvbsub av_interleaved_write_frame				0	0
