<HTML><BODY><div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16726707970753945901_BODY"><div class="cl_768366"><div><div class="gmail_quote_mr_css_attr"><div class="gmail_attr_mr_css_attr">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> </div><div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div><div class="js-helper js-readmsg-msg"><div><div><div class="cl_768366"><div><div class="gmail_quote_mr_css_attr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote_mr_css_attr"><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></div></BODY></HTML>