<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>I had the same problem as you, but this worked for me: "<span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">I tried sending a NULL packet and using avocdec_flush_buffers()
 to flush out the decoded frame</span>"<br>
</p>
<p>Even though it was functionally correct, that approach was too slow. If I remember correctly that was due to (re)initialization time for the decoder.<br>
</p>
<p><br>
</p>
<p>However, I ended up moving all the decode to NVDEC directly anyway.<br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> on behalf of rohit khali <khali.rohit@gmail.com><br>
<b>Sent:</b> Friday, November 6, 2020 12:43 AM<br>
<b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.<br>
<b>Subject:</b> [EXTERNAL] [Libav-user] FFMPEG to decode I frames</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse; border:none">
<tbody>
<tr style="height:15.25pt">
<td width="711" valign="top" style="width:842.35pt; border:solid #ED7D31 1.5pt; padding:0in 5.4pt 0in 5.4pt; height:15.25pt">
<p><strong><span style="background:#FFFF99">CAUTION</span></strong><span style="background:#FFFF99">: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div>
<div dir="ltr">Hi,<br>
<div><br>
</div>
<div>My application parses only I frames from H264 bit stream and hands it over to FFMPEG decoder.</div>
<div>Expectation was that FFMPEG decoder  immediately output decoded frames since input is I frame. However, FFMPEG can't do this especially for cases where I frame is not an IDR.</div>
<div><br>
</div>
<div>I tried sending a NULL packet and using avocdec_flush_buffers() to flush out the decoded frame but this logic doesn't seem to work for all cases, maybe again depending on DPB size or POC.</div>
<div>I was wondering if anyone else has used FFMPEG for such a use case earlier and what else I can use to immediately receive the I frames.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Rohit Khali</div>
</div>
</div>
</div>
</div>
</body>
</html>