<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 id="style_16729300490094053812_BODY"><div class="cl_006673"><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>If you use libx264 encoder, have you tried tune zerolatency compensation flag?</div></blockquote></div></div></div></div></div></blockquote></div><div><div><div>Of course I use it like this</div></div></div><div> </div><div>av_dict_set(&pDicOut, "tune", "zerolatency", 0);</div><div>avcodec_open2(pCdcCtxOut, pCdcOut, &pDicOut);</div><div> </div><div>I probably still have a mistake somewhere in incorrect values or incorrect use of these variables</div><div>AVCodecContext->time_base</div><div>AVStream->avg_frame_rate</div><div>AVStream->r_frame_rate</div><div><div> </div><div>Maybe for outgoing AVFrames it is necessary to count pts/dts in AVStream->time_base, but for AVPacket use AVCodecContext->time_base?</div></div></BODY></HTML>