Opened 7 months ago

Last modified 7 months ago

#6972 new defect

Application provided invalid, non monotonically increasing dts to muxer in stream....resulting in audio synch issues

Reported by: RingoTheDog Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I keep getting the errors: Application provided invalid, non monotonically increasing dts to muxer in stream
....resulting in audio synch issues

How to reproduce:
ffmpeg.exe -i "Andrew Holness.mp4" -vf "scale=iw*sar:ih, pad=max(iw\,ih*(16/9)):ow/(16/9):(ow-iw)/2:(oh-ih)/2" -pix_fmt yuv422p -vcodec mpeg2video -flags +ildct+ilme -top 1 -dc 10 -qmin 1 -lmin "1*QP2LAMBDA" -vtag xdv3 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -g 15 -bf 2 -aspect 16:9 -r 29.97 -s 1920X1080 -async 2 -acodec pcm_s24le -ar 48000 -f mxf -y "Andrew Holness.mp4.MXF"

Example source file:
http://s000.tinyupload.com/?file_id=40468444508201894852

this file does the same:
http://s000.tinyupload.com/?file_id=93500756624945791830

If files are first run through tsMuxeR this ffmpeg issue can be avoided.

JFYI....These were both Twitter video files.

https://pastebin.com/iGySyxdN

Change History (3)

comment:1 in reply to: ↑ description Changed 7 months ago by cehoyos

Replying to RingoTheDog:

JFYI....These were both Twitter video files.

Twitter uses FFmpeg to create mp4 files? That surprises me...

Please try to simplify your command line and provide command line together with complete, uncut console ouput (of current FFmpeg git head) to make this a valid ticket.

comment:2 Changed 7 months ago by RingoTheDog

After some further playing I believe the with the "non monotonically increasing dts to muxer in stream 1" error and subsequent out of synch issues happen because of the "-async 2" option being added.

I had been using the async option/originally posted script with many many video files over the years, and it has only recently been encountering these monotonically increasing dts errors with certain twitter videos.




:\>ffmpeg.exe -i "Andrew Holness.mp4" -vcodec mpeg2video -async 2 -f mxf -y "Andrew Holness.MXF"
ffmpeg version N-89832-g07a96b6251 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  5.100 / 58.  5.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Andrew Holness.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.31.100
  Duration: 00:02:11.04, start: 0.000000, bitrate: 720 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 583 kb/s, 29.98 fps, 29.97 tbr, 90k tbn, 59.93 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
-async is forwarded to lavfi similarly to -af aresample=async=2:min_hard_comp=0.100000:first_pts=0.
Output #0, mxf, to 'Andrew Holness.MXF':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.5.100
    Stream #0:0(und): Video: mpeg2video (Main), yuv420p, 1280x720, q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.9.100 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc58.9.100 pcm_s16le
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 0
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 1007
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 2080
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 7232
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 12384
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 17536
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 22688
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 27840
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 32992
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 38144
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 43296
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 47392
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 48000
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 53152
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 57248
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 61344
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 65440
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 69536
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 73632
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 77728
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 81824
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 85920
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 90016
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 94112
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 98208
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 102304
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 106400
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 110496
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 114592
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 118688
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 122784
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 126880
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 130976
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 135072
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 139168
[mxf @ 00000220fa5f86c0] Application provided invalid, non monotonically increasing dts to muxer in stream 1: 143360 >= 143264
frame= 3928 fps=332 q=31.0 Lsize=   44313kB time=00:02:11.03 bitrate=2770.3kbits/s dup=1 drop=0 speed=11.1x
video:15570kB audio:25134kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.865341%

comment:3 Changed 7 months ago by cehoyos

Why do you need the option -async 2 for the given sample?

Note: See TracTickets for help on using tickets.