<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 4, 2014 at 2:31 PM, Alina lifshits <span dir="ltr"><<a href="mailto:alina@vicon.co.il" target="_blank">alina@vicon.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am using avcodec decoder to decode h264 stream. I noticed that the decoder buffers a few first frames before returning a decoded picture. <u></u><u></u></p><p class="MsoNormal">The stream is from a live source and does not contains B frames. Is there a way to tell the decoder not to buffer frames, or maybe to buffer just 1 or 2 at most?<u></u><u></u></p><p class="MsoNormal">Since I am working with a live video, it very important for me to keep small latency.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><br></p></div></div></blockquote><div><br></div><div>To minimize latency, make sure you turn off frame-threaded decoding. You can still use slice-threading (if your video has slices), but frame-threading has an inherent delay.</div><div>Additionally, there is a flag to force low delay decoding, but I'm not certain it work for H.264. You could look into that.</div><div><br></div><div>- Hendrik</div></div></div></div>