<div dir="ltr">Thanks again, Carl.<div><br></div>>I may miss something but I believe now your pts are wrong,<br>>I suspect a B-frame is shown first.<br><div><br></div><div>In my fictional model, I thought the I frame (frame-0) would come first and then the two B frames (frame-1,frame-2) and finally the P frame (frame-3)</div><div><br></div><div>I hope this is now fixed, assuming we chose a timebase of 1/75 (with a timescale of 75). Given that our video runs at 25 FPS, therefore, we'll need to increase our PTS in 75/30 (timescale/FPS) = 3 PTS per frame.</div><div><br></div><div><font face="monospace">FRM 0 1 2 3 </font></div><div><font face="monospace">FRT I B B P</font></div><div><font face="monospace">PTS 0 1 2 3</font></div><div><font face="monospace">DTS 0 3 2 2</font></div><div><font face="monospace">PTT 0 0.04 0.08 0.12 (PTS * timebase)</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">FRM=frames number</font></div><div><font face="monospace">FRT=frames types</font></div><div><span style="font-family:monospace;font-size:10.5625px">FTT=PTS time</span><br></div><div><span style="font-family:monospace;font-size:10.5625px"><br></span></div><div>As far as I understood we could pick any time base to calculate the PTS_TIME, for instance, let's use the timebase 1/15360 (timescale of 15360)  which gives 512 ticks per frame (on a 30 FPS video).</div><div><br></div><div>Frame #0 PTS=0<but it could be any initial number> PTS_TIME=0</div><div>Frame #1 PTS=512 PTS_TIME= 512/15360 = 0.0333</div><div>Frame #2 PTS=1024 PTS_TIME= 1024/15360 = 0.066</div><div>Frame #2 PTS=1536 PTS_TIME=1536/15360 = 0.1</div><div>...</div><div>Frame #29 PTS=14848 PTS_TIME=14848/15360 = 0.966<br></div><div><br></div><div>When we look at MPEGTS we can see that they used 90K as timescale (or 1/90k) for some, apparently, hardware reasons but in all the other cases, can I just pick any number to be my timescale?</div><div><br></div><div>Thanks</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 13, 2017 at 10:33 PM Carl Eugen Hoyos <<a href="mailto:ceffmpeg@gmail.com">ceffmpeg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2017-11-14 1:27 GMT+01:00 Leandro Moreira <<a href="mailto:leandro.ribeiro.moreira@gmail.com" target="_blank">leandro.ribeiro.moreira@gmail.com</a>>:<br>
><br>
> Thanks, Carl!!!<br>
><br>
>> PTS 0 1 2 3 (when it needs to be present, order)<br>
>> DTS 0 3 1 1(when it needs to be decoded)<br>
><br>
> Yes =(, you're right, it was supposed to be DTS 0 3 1 2<br>
<br>
> (assuming 0 is an I-Frame, 1 and 2 were a B-Frames that<br>
> depend on 3 and 3 is P-Frame).<br>
<br>
I may miss something but I believe now your pts are wrong,<br>
I suspect a B-frame is shown first.<br>
<br>
I cannot really answer your other questions but I know that<br>
H.264 streams exist for which FFmpeg is unable to produce<br>
correct timestamps.<br>
(The specification is apparently non-trivial.)<br>
<br>
Please fix your quoting, do not mix quoting-styles!<br>
<br>
Carl Eugen<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div>