Opened 13 years ago

Closed 6 years ago

Last modified 6 years ago

#1154 closed defect (fixed)

Application provided invalid, non monotonically increasing dts to muxer

Reported by: Greeny Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: av_interleaved_write_frame flv h264
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I am trying to remux a rtmpdump created .flv file with h264 video and speex audio into an .mp4 file. To do this I am copying the h264 video and converting the speex audio to aac using libfaac. However, when attempting this I get the following error:

[mp4 @ 0x10180c400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 54363 >= 54363
av_interleaved_write_frame(): Invalid argument

When using an older version of ffmpeg (specifically SVN-r25783 from 2010) the h264 video is copy okay even though there are a lot of errors such as:

[mp4 @ 0x10101cc00] st:0 error, non monotone timestamps 97547 >= 97547

Even with these errors the video turns out fine. I have attached a -report from the command that produces the error.

Attachments (3)

ffmpeg-20120331-070413.log (2.1 KB ) - added by Greeny 13 years ago.
denykiss.flv (2.0 MB ) - added by Greeny 13 years ago.
.flv file with h264 video and speex audio
ffmpeg-20120331-171246.log (2.1 KB ) - added by Greeny 13 years ago.
-report for sample file

Download all attachments as: .zip

Change History (18)

by Greeny, 13 years ago

Attachment: ffmpeg-20120331-070413.log added

in reply to:  description comment:1 by Carl Eugen Hoyos, 13 years ago

Keywords: av_interleaved_write_frame flv h264 added
Version: 0.10.2git-master

Replying to greenythebeast:

[mp4 @ 0x10101cc00] st:0 error, non monotone timestamps 97547 >= 97547

Even with these errors the video turns out fine.

The resulting file was invalid and if any player could play it, it was pure luck.

Please provide the input sample.

Possibly a duplicate of ticket #1125.

comment:2 by Greeny, 13 years ago

Just for some background info, the older version of ffmpeg that I used was downloaded from here: http://trick77.com/2010/11/22/how-to-convert-flv-flash-video-to-mp4-on-the-mac/

In his post, he mentions "I also had to apply a small fix in utils.c so ffmpeg doesn’t abort with “error, non monotone timestamps n >= n” while remuxing slightly out-of-sync Flash videos." Those are the errors that show up using that older build but the file still turns out fine. I imagine the timestamp errors are because when you download a live stream using rtmpdump, the resulting .flv file is unseekable. Every file I've remuxed with the older build plays fine in several media players, even with those errors.

As for the input sample, the file is of a pornographic nature. I'll try to upload a portion where nothing is going on later tonight if that's alright with everyone! ;)

Edit: I can also provide a sample of an output file from the older build (the one that works) if that helps in anyway.

Last edited 13 years ago by Greeny (previous) (diff)

by Greeny, 13 years ago

Attachment: denykiss.flv added

.flv file with h264 video and speex audio

by Greeny, 13 years ago

Attachment: ffmpeg-20120331-171246.log added

-report for sample file

comment:3 by Greeny, 13 years ago

I've attached a different sample file with no naughty content as well as the -report for the file indicating the same problem. If you need anything else from me, please don't hesitate to ask.

comment:4 by Greeny, 13 years ago

I thought I'd let anyone know that I applied the patch suggested in this ticket: http://ffmpeg.org/trac/ffmpeg/ticket/177

Everything works fine now. I'm sure that could theoretically bite me in the ass down the road since I'll admit I have absolutely no clue what that code does but the output file works fine with the patch applied.

comment:5 by Carl Eugen Hoyos, 13 years ago

Reproduced by developer: set
Status: newopen

comment:6 by Greeny, 13 years ago

I'm just curious, but what does this error even mean?

comment:7 by Elon Musk, 13 years ago

What patch you applied? and to what muxer?

comment:8 by Roger Pack, 12 years ago

that patch said it was applied, so I assume this works for you now?

comment:9 by Carl Eugen Hoyos, 12 years ago

Still reproducible with current git head:

$ ffmpeg -i denykiss.flv -vcodec copy -an out.mp4
ffmpeg version N-43716-g92b8c9d Copyright (c) 2000-2012 the FFmpeg developers
  built on Aug 18 2012 18:47:44 with gcc 4.6.1 (GCC)
  configuration: --cc=/usr/local/gcc-4.6.1/bin/gcc
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 53.100 / 54. 53.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 11.101 /  3. 11.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
Guessed Channel Layout for  Input Stream #0.1 : mono
Input #0, flv, from 'denykiss.flv':
  Duration: 00:03:23.27, start: 0.000000, bitrate: 82 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 15 tbr, 1k tbn, 30 tbc
    Stream #0:1: Audio: speex, 16000 Hz, mono
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf54.25.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 1k tbn, 1k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x1485080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2673 >= 2673
av_interleaved_write_frame(): Invalid argument

comment:10 by Michael Niedermayer, 12 years ago

Resolution: fixed
Status: openclosed

Fixed for the sample provided. I cannot say for sure if AV sync is ok or if further issues remain.
If some issues remain with this sample then please reopen this ticket.
If the same error shows up with other files then please open seperate tickets, its unlikely that it would be the same bug.

comment:11 by mikhailov, 12 years ago

Reference to #2085

comment:12 by bivinix, 6 years ago

Resolution: fixed
Status: closedreopened

I am encountering this same issue with:

ffmpeg version N-88804-g3af2bf0af0 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 7.2.0 (GCC)

I get the error trying to copy a Blu-Ray m2ts with subtitles. It doesn't matter what codecs I use. If I leave out subtitles, the operation works.

comment:13 by bivinix, 6 years ago

I just tried with:

ffmpeg version N-93863-g58d167bcd5 Copyright (c) 2000-2019 the FFmpeg developers

built with gcc 8.3.1 (GCC) 20190414

I get the error messages but it doesn't abort the operation. Instead, I get hundreds of messages like this:

Non-monotonous DTS in output stream 0:2; previous: 291274410, current: 291274408; changing to 291274411. This may result in incorrect timestamps in the output file.

I'll check the resulting file, once it's done. I'm doing a copy operation for all codecs (audio, video, subtitle).

-- update --

Hmm, the output file was no good. It had the audio/video tracks but the subtitles didn't work and showed up as a "Data: bin_data" streams.

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

comment:14 by Carl Eugen Hoyos, 6 years ago

Resolution: fixed
Status: reopenedclosed

Please so not reopen seven-year old tickets.

Version 0, edited 6 years ago by Carl Eugen Hoyos (next)

in reply to:  14 comment:15 by bivinix, 6 years ago

Replying to cehoyos:

Please do not reopen seven-year old tickets.

Understood. Thanks for letting me know!

Note: See TracTickets for help on using tickets.