<div dir="ltr">Hi,<div><br></div><div>  I have some questions about extracting the time stamps:</div><div><br></div><div>1. Given a packet, I have AVPacket.pts and also AVFrame.pts and AVFrame.pkt_pts.</div><div>I noticed that every few frames (about 1 in 3) AVPacket.pts is different from AVFrame.pts and AVFrame.pkt_pts - after avcodec_decode_video2().</div>

<div><br></div><div>Which one should I be using to do fps dropping?</div><div><br></div><div>How do I access the correct timestamp (is there a function instead of direct access?) and how do I measure the difference in msec?</div>

<div><br></div><div>Thanks,</div><div>Adi</div><div><br></div><div><br></div><div><br></div><div><div class="gmail_quote">On Tue, Jul 30, 2013 at 1:34 PM, Alex Cohn <span dir="ltr"><<a href="mailto:alexcohn@netvision.net.il" target="_blank">alexcohn@netvision.net.il</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jul 30, <a href="tel:2013" value="+9722013">2013</a> at 12:35 PM, Adi Shavit <<a href="mailto:adishavit@gmail.com">adishavit@gmail.com</a>> wrote:<br>


> Hi Mike,<br>
><br>
><br>
> On Tue, Jul 30, <a href="tel:2013" value="+9722013">2013</a> at 11:13 AM, mikeversteeg <<a href="mailto:mike@mikeversteeg.com">mike@mikeversteeg.com</a>> wrote:<br>
>> Check the PTS of each frame and use that to decide whether to throw it out or<br>
>> not.<br>
><br>
> Ah, thanks.<br>
> These will give me the play-timestamps, right?<br>
><br>
>> That way there is no need to decode frames you won't be using.<br>
> Do you mean, no need to PROCESS, not decode.<br>
> Don't I have to decode all frames?<br>
> If I could not-decode (via the decoder) some of the frames that would<br>
> be great and further save cpu. Can I do that, just skip some encoded<br>
> frames? Wouldn't that mess up the following frames?<br>
><br>
> Thanks,<br>
> Adi<br>
<br>
</div></div>You must decode all frames, or skip to the next IDR frame, if you want<br>
to avoid artiifacts. Yes PTS is play timestamp. The units may depend<br>
on your stream format, and are generally expressed in terms of the<br>
timebase.<br>
<br>
BR,<br>
Alex Cohn<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div></div>