Help with error: "Non-monotonous DTS in output stream"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with error: "Non-monotonous DTS in output stream"

avirex
Hello.

I am re-streaming a Live H264/AAC stream using ffmpeg (windows).  After about 1 hour I'm getting the following error in the console:
 
Non-monotonous DTS in output stream 0:0; previous: 38226576, current: 31954543;
changing to 38226576. This may result in incorrect timestamps in the output file.

Here is the command I am using:

ffmpeg.exe -threads 0 -i "$rurl playpath=$rplaypath swfUrl=$rswfurl pageUrl=$rpageurl live=1 " -map_metadata -1 -loglevel info -f flv -acodec copy -vcodec copy -r 15 -aspect 16:9 -bufsize 12000k "rtmp://localhost/$dapp/$dstream"  2> F:\Streams\$dstream.log
 

Any idea what this error message means and how to mitigate?  Here is a bit more detail from the log, when the error actually starts...

negative cts, previous timestamps might be wrong
DTS 4294905094, next:4418668000 st:0 invalid dropping
PTS 4294905094, next:4418668000 invalid dropping st:0
frame=110408 fps= 25 q=-1.0 size=  326675kB time=01:13:38.89 bitrate= 605.6kbits/s    
frame=110526 fps= 25 q=-1.0 size=  327025kB time=01:13:43.61 bitrate= 605.6kbits/s    
negative cts, previous timestamps might be wrong
[flv @ 0000000004a72a60]
Non-monotonous DTS in output stream 0:0; previous: 4423587, current: -52282;
changing to 4423587. This may result in incorrect timestamps in the output file.
[flv @ 000000000039f900]
negative cts, previous timestamps might be wrong
[flv @ 0000000004a72a60]
Non-monotonous DTS in output stream 0:0; previous: 4423587, current: -52202;
changing to 4423587. This may result in incorrect timestamps in the output file.


So you can see at that point the the DTS/PTS status message is completed replaced by the "Non-monotonous DTS" error.  Also notice the "current" value is negative and then climbs back to positive value.


Thanks for any insight.
Reply | Threaded
Open this post in threaded view
|

Re: Help with error: "Non-monotonous DTS in output stream"

Andrey Utkin
2013/5/13 avirex <[hidden email]>:
> Hello.
>
> I am re-streaming a Live H264/AAC stream using ffmpeg (windows).  After
> about 1 hour I'm getting the following error in the console:
>
... skipped...
>
> So you can see at that point the the DTS/PTS status message is completed
> replaced by the "Non-monotonous DTS" error.  Also notice the "current" value
> is negative and then climbs back to positive value.
>
>
> Thanks for any insight.

Well, from my own experience on RTMP streams, it really may give you
non-monotonic timestamps, so it is not a ffmpeg mistake.
The other question is - is there any problem with saved video? If
none, you may ignore this output.

--
Andrey Utkin
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Help with error: "Non-monotonous DTS in output stream"

avirex
Hi Andrey.

First, thanks for your response.

Yes, I am re-streaming an incoming RTMP stream (using librtmp) and pushing that out to my own localhost RTMP server.  So actually I am not saving the stream.

From the end user perspective, when trying to watch the resultant stream coming from my RTMP server, as soon as these messages begin appearing the output video begins pausing and getting "stuck" while the audio continues flowing.  The problem gets worse and worse until it is unwatchable.

The interesting thing is, I have 4 other streams running using the exact same ffmpeg binary and coming from the exact same source, but they are not exhibiting this behavior at all.  Very odd.

Thanks again for any help.
Reply | Threaded
Open this post in threaded view
|

Re: Help with error: "Non-monotonous DTS in output stream"

Andrey Utkin
2013/5/14 avirex <[hidden email]>:
> Yes, I am re-streaming an incoming RTMP stream (using librtmp) and pushing
> that out to my own localhost RTMP server.  So actually I am not saving the
> stream.
>
> From the end user perspective, when trying to watch the resultant stream
> coming from my RTMP server, as soon as these messages begin appearing the
> output video begins pausing and getting "stuck" while the audio continues
> flowing.  The problem gets worse and worse until it is unwatchable.

So it (ffmpeg as i understand) discards frames with non-monotonic timestamps.
I'd make something to log all the timestamps into file, to investigate
the pattern and make a strategy. You may need slightly modify ffmpeg
sources for it, if it does not give it to you as is.
You could also use (or add) some option to make ffmpeg exit on such
error, so you could automatically restart it from script.

> The interesting thing is, I have 4 other streams running using the exact
> same ffmpeg binary and coming from the exact same source, but they are not
> exhibiting this behavior at all.  Very odd.

Yes, it's weird. What if it is some "logics" of rtmp server, managing
content sent to particular watcher? Maybe your server inserts
commercials time to time, not for all watchers at once, but on
particular watchers separately?
Good luck fighting!


--
Andrey Utkin
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user