<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 30, 2014 at 3:05 AM, wm4 <span dir="ltr"><<a href="mailto:nfxjfg@googlemail.com" target="_blank">nfxjfg@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On Tue, 29 Apr 2014 12:13:01 -0700<br>
J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
<br>> I had the same sort of sequential PTS in some videos; another place to<br>
> ignore that and use your own frame count based PTS... like MP4 clips come<br>
> in ticks, mkv come in milliseconds in the PTS and some are sequential<br>
> counts (avi)  and even playing from disk I got backwards numbers<br>
<br>
</div>Seems like you don't understand timestamps at all.<br>
<br>
First, PTS can go backwards on the packet level. This is because some<br>
codecs reorder frames on decoding. Packet PTS are in encoded order, not<br>
in display order, and the decoder will reorder the PTS to display order<br>
for you (just like it reorders the decoded pictures). See AVFrame<br>
fields for more info.<br>
<br>
Second, timestamps in ffmpeg are always relative to a timebase. The<br>
timebase tells you in what units the PTS values are in. You just divide<br>
the PTS by the timebase, and you get the time in seconds. The<br>
demuxer will tell you the timebase; see AVStream.time_base.<br></blockquote><div><br></div><div><br></div><div>if that was true, which is what the documentation would lead one to beleive... then I wouldn't need the three exceptions based on input format to figure how to use the PTS.</div>
<div><br></div><div><div><span class="" style="white-space:pre">                                </span>if( file->pFormatCtx->duration_estimation_method == AVFMT_DURATION_FROM_PTS )</div><div><span class="" style="white-space:pre">                                </span>{</div>
<div><span class="" style="white-space:pre">                                            </span>if( file->pVideoCodecCtx->time_base.num == 1 && file->pVideoCodecCtx->time_base.den > 50000 )<br></div></div><div><br></div><div>the PTS is already in milliseconds... so a value at the beginning '133' would not be unreasonable... applying the time_base ... 133 * 1 / 65535 = 0... so for most of the movie I get a 0 value if I use the time_base as suggested.</div>
<div> </div><div>but that's not the topic... and I diverge</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><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>