Opened 7 years ago

Closed 6 years ago

#6248 closed defect (fixed)

non monotonically increasing dts - skip badly broken subtitles

Reported by: Evren Yurtesen Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: dvbsub av_interleaved_write_frame
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I have problems with subtitles in dvb streams with ffmpeg 3.2.4

[mpegts @ 0x55a081ad1220] Application provided invalid, non monotonically increasing dts to muxer in stream 2: 186981224 >= 186884791
av_interleaved_write_frame(): Invalid argument

Due to the large difference in positions, I expect there is a problem in the subtitle stream.

I tried the -fix_sub_duration option and it does not help. So I am thinking the issue is not related to previous subtitle duration being too long.

I think a solution would be skipping broken subtitles with a warning instead of exiting with conversion failed error. I would rather lose some apparently not working subtitles than conversion being stopped. Is this possible?

I used dd to cut to the position where the problem is.

Command:
# /usr/bin/ffmpeg -y -fix_sub_duration -i /tmp/vera.ts -c:s copy /tmp/vera2.ts

Error:
[mpegts @ 0x55ee74fb22c0] Application provided invalid, non monotonically increasing dts to muxer in stream 2: 281690 >= 7438

Attachments (1)

vera.ts (231.5 KB ) - added by Evren Yurtesen 7 years ago.
sample file causing problem…

Download all attachments as: .zip

Change History (7)

by Evren Yurtesen, 7 years ago

Attachment: vera.ts added

sample file causing problem...

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: dvbsub av_interleaved_write_frame added; dvb subtitle monotonically removed

Please test current FFmpeg git head and provide the command line that allows to reproduce the issue together with the complete, uncut console output to make this a valid ticket.

comment:2 by Evren Yurtesen, 7 years ago

Please ignore the invalid frame dimensions errors. They are probably due to me cutting the file very small using dd.

The actual problem is:

[mpegts @ 0x207a760] Application provided invalid, non monotonically increasing dts to muxer in stream 2: 281690 >= 7438 av_interleaved_write_frame(): Invalid argument

Full output:

$ ./ffmpeg -y -fix_sub_duration -i vera.ts -c:s copy vera2.ts
ffmpeg version N-84156-g23f3f92 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: 
  libavutil      55. 48.100 / 55. 48.100
  libavcodec     57. 83.100 / 57. 83.100
  libavformat    57. 66.104 / 57. 66.104
  libavdevice    57.  3.100 / 57.  3.100
  libavfilter     6. 77.100 /  6. 77.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
[mp3 @ 0x20400c0] Header missing
[mp3 @ 0x207b920] Header missing
[mpeg2video @ 0x203eee0] Invalid frame dimensions 0x0.
    Last message repeated 10 times
[mpegts @ 0x203a400] PES packet size mismatch
    Last message repeated 5 times
Input #0, mpegts, from 'vera.ts':
  Duration: 00:00:02.16, start: -2.867556, bitrate: 877 kb/s
  Program 17 
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 224 kb/s
    Stream #0:2[0x403](fin): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:3[0x1388](fin): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
  No Program
    Stream #0:4[0x28c]: Audio: mp2, 48000 Hz, stereo, s16p, 160 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (mp2 (native) -> mp2 (native))
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mp2 @ 0x207c2e0] Header missing
Error while decoding stream #0:1: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpeg2video @ 0x207be00] Invalid frame dimensions 0x0.
Error while decoding stream #0:0: Invalid data found when processing input
[mpegts @ 0x203a400] PES packet size mismatch
[mpeg2video @ 0x207be00] ac-tex damaged at 16 0
[mpeg2video @ 0x207be00] Warning MVs not available
[mpeg2video @ 0x207be00] concealing 1620 DC, 1620 AC, 1620 MV errors in I frame
Output #0, mpegts, to 'vera2.ts':
  Metadata:
    encoder         : Lavf57.66.104
    Stream #0:0: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.83.100 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Metadata:
      encoder         : Lavc57.83.100 mp2
    Stream #0:2(fin): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
[mpegts @ 0x207a760] Application provided invalid, non monotonically increasing dts to muxer in stream 2: 281690 >= 7438
av_interleaved_write_frame(): Invalid argument
frame=    0 fps=0.0 q=0.0 Lsize=      37kB time=00:00:03.12 bitrate=  95.6kbits/s speed=36.2x    
video:0kB audio:28kB subtitle:4kB other streams:0kB global headers:0kB muxing overhead: 13.177638%
Conversion failed!

comment:3 by Evren Yurtesen, 7 years ago

Version: 3.2.1git-master

comment:4 by Hans Carlson, 7 years ago

FYI. The suggested change in https://trac.ffmpeg.org/ticket/4450 also appears to fix this issue.

comment:5 by Evren Yurtesen, 7 years ago

@forbyta will that change ever be included in a release? that report is 2+ years old.

comment:6 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedffmpeg
Resolution: fixed
Status: newclosed

The patch from ticket #4450 was applied as a790813739a880a0a86084ec8c4e2d5a6a79c11d

Note: See TracTickets for help on using tickets.