<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Thanks, Ivanov. <br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
I'll stick to my current solution now.<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Same as you, will further consider the way ffmpeg workaround it in the future.<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Get <a href="https://aka.ms/ghei36">Outlook for Android</a></div>
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> on behalf of Hristo Ivanov <hivanov.ffmailing@gmail.com><br>
<b>Sent:</b> Wednesday, October 24, 2018 10:08:57 PM<br>
<b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.<br>
<b>Subject:</b> Re: [Libav-user] Inconsistent dts/pts in packets read by av_read_frame from rtsp stream. Is it expected behavior?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr"><font face="arial, helvetica, sans-serif">Hi Yang,</font>
<div><font face="arial, helvetica, sans-serif"><br>
</font></div>
<div><font face="arial, helvetica, sans-serif">> <span style="color:rgb(0,0,0); white-space:pre-wrap">While I'm using av_read_frame to extract frames from some rtsp stream from IP cameras, the dts/pts of the next frame occasionally will be smaller than the
 previous frames.</span></font></div>
<div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">Currently I am facing the same problem.</span></font></div>
<div><span style="color:rgb(0,0,0); white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0); white-space:pre-wrap">>
</span><span style="color:rgb(0,0,0)">Is it a bug of libav or a P frame or maybe there's a bug in the IP cameras' rtsp implementation?</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">I doubt this being a bug with libav, but I can not tell if it is a bug in the IP cameras or something inherited from the rtsp protocol itself.</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">> </span></font><span style="color:rgb(0,0,0); font-family:sans-serif">then I should discard the consequent frames with smaller dts when I mux it to avoid non increasing dts, should
 I?</span></div>
Currently my solution to this problem does exactly this, but ffmpeg(the tool) uses other solution, which is to modify the pts/dts values. [
<a href="https://github.com/FFmpeg/FFmpeg/blob/master/fftools/ffmpeg.c#L782">https://github.com/FFmpeg/FFmpeg/blob/master/fftools/ffmpeg.c#L782</a> ]</div>
<div>My current solution works fine, but I will try the one ffmpeg uses.</div>
<div><br>
</div>
<div>I hope this helps.</div>
<div dir="ltr"><br>
</div>
</div>
</div>
</body>
</html>