<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 2, 2023 at 3:13 PM wolverin via Libav-user <<a href="mailto:libav-user@ffmpeg.org">libav-user@ffmpeg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><blockquote style="border-left:1px solid rgb(8,87,166);margin:10px;padding:0px 0px 0px 10px"><div id="m_-404747493619054020"><div><div><div id="m_-404747493619054020style_16726605471556409646_BODY"><div><div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div id="m_-404747493619054020m_-7615466201307963749style_16726579780851210439_mr_css_attr"><div id="m_-404747493619054020m_-7615466201307963749style_16726579780851210439_BODY_mr_css_attr"><div><div><div><div><div><div><em>Output #0, rtsp, to 'rtsp://<a href="http://127.0.1.1:555" target="_blank">127.0.1.1:555</a>':</em></div><div><em>  Stream #0:0: Video: h264, yuv422p(tv, bt470bg/unknown/unknown), 1280x720, q=2-31, 500 kb/s, 15 tbr, 90k tbn</em></div></div></div><div> </div><div> </div><div>I compared such an approximate calculation of pts/dts in ffprobe for my code and ffmpeg and they match until the real fps becomes different from the calculated one, then I see either delays or frame losses in VLC.</div></div></div></div></div></div></div></div></blockquote><div> </div><div>You can not use 15 from video frame rate to calculate PTS when video is variable frame rate.</div></div></div></div></div></div></div></div></blockquote><div> </div><div>ok, but then how do I calculate the pts/dts of each frame correctly???</div></div></blockquote><div><br></div><div>PTS is represented as relative time starting from 0 for start of file.</div><div><br></div><div>PTS is just a int64_t number that tells relative time.</div><div>To know time resolution one use timebase.num/den, so they are actually tied together with pts timestamp.</div><div><br></div><div>If video is VFR than there are gaps e.g. non-monotonous increasing of pts from older to newer ones.</div><div><br></div><div>Say time of frame is 5.5 seconds and timebase used is 1/90000 than time of 1 second would have value of 90000 stored in pts.</div><div>5.5 seconds would then be 5*90000 + 0.5*90000.</div><div><br></div><div>Hope that you can conclude from this demonstration how to solve your problem.</div><div><br></div><div>To rescale PTS from one timebase resolution to another one use av_rescale_q().</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>I want my SoC ARM to provide maximum transcoding speed, this is especially important for a resolution of 1920x1080 when fps is 8-11</div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
</blockquote></div></div>