<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 4:51 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><div><blockquote style="border-left:1px solid rgb(8,87,166);margin:10px;padding:0px 0px 0px 10px"><div id="m_-2238968379547552665"><div><div><div id="m_-2238968379547552665style_16726707970753945901_BODY"><div><div><div><div>Did I understand you correctly that I need to multiply time_base and system time between adjacent frames and add the resulting time to the previous PTS?</div><div> </div><div>Nope.</div><div>PTS is just timebase * seconds represented as int64 number</div><div> </div><div>There are no additions with next/prev pts values.</div><div> </div></div></div></div></div></div></div></div></blockquote></div><div> </div><div>Then pts is the time of one frame?</div></div></blockquote><div><br></div><div>Yes, when used with tied time_base AVRational.</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> </div><div><blockquote style="border-left:1px solid rgb(8,87,166);margin:10px;padding:0px 0px 0px 10px"><div><div><div><div><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> </div><div>I used av_rescale_q to scale time_base from an incoming MJPEG stream to an outgoing H264 one, but for some reason timestamps pts/dts are meaningless in this case.</div></div></div></blockquote><div> </div><div>Show your code.</div></div></div></div></div></div></div></div></blockquote><div> </div><div>I have greatly simplified it to understand how I am trying to use avscale, as it is done in different threads using buffers to use other ARM cores.</div><div> </div><div><div><div>avcodec_send_packet(pCdcCtxInp, pPktInp);</div><div>avcodec_receive_frame(pCdcCtxInp, pFrm);</div></div><div><div>pFrm->pts = av_rescale_q(pPktInp->pts, pFmtCtxInp->streams[0]->time_base, pCdcCtxInp->time_base);</div><div> </div><div><div><div>avcodec_send_frame(pCdcCtxOut, pFrm);</div></div><div>avcodec_receive_packet(pCdcCtxOut, pPktOut);</div><div>pPktOut->pts = av_rescale_q(pFrm->pts, pCdcCtxInp->time_base, pCdcCtxOut->time_base);</div><div>pPktOut->dts = pPktOut->pts;</div></div></div></div></div></div></blockquote><div><br></div><div>Inspect values of input/output pts and used timebases(with printfs or other ways...) and you can figure it where PTS becomes nonsense.</div></div></div>