<div dir="ltr">Hi all,<div><br></div><div>I wants to know that number of frames(AVFrame) in video packet (AVPacket). I have tested this with some sample .mp4 and .mkv file format and got to know that each AVPacket contains one AVFrame. Is it fixed.?  </div><div><br></div><div><font color="#000000">while (</font><a class="gmail-code" href="https://ffmpeg.org/doxygen/4.0/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(70,101,162);text-decoration-line:none">avcodec_send_packet</a><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap">(dec_ctx, pkt) >= 0)</span></div><div><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap">{</span></div><div><font color="#000000" face="monospace, fixed"><span style="white-space:pre-wrap">//should i put another while loop here to decode frames in packet.?</span></font></div><div><span style="font-size:13px;color:rgb(0,0,0);font-family:monospace,fixed;white-space:pre-wrap">    ret = </span><a name="a11" style="font-size:13px;font-family:monospace,fixed;white-space:pre-wrap;color:rgb(61,87,140)"></a><a class="gmail-code" href="https://ffmpeg.org/doxygen/4.0/group__lavc__decoding.html#ga11e6542c4e66d3028668788a1a74217c" style="font-size:13px;font-family:monospace,fixed;white-space:pre-wrap;color:rgb(70,101,162);text-decoration-line:none">avcodec_receive_frame</a><span style="font-size:13px;color:rgb(0,0,0);font-family:monospace,fixed;white-space:pre-wrap">(dec_ctx, frame);</span></div><div><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(224,128,0)">    if</span><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap"> (ret == </span><a name="a12" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(61,87,140)"></a><a class="gmail-code" href="https://ffmpeg.org/doxygen/4.0/group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(70,101,162);text-decoration-line:none">AVERROR</a><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap">(EAGAIN) || ret == </span><a name="a13" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(61,87,140)"></a><a class="gmail-code" href="https://ffmpeg.org/doxygen/4.0/group__lavu__error.html#gab4faa0afdf35076914824200331defff" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(70,101,162);text-decoration-line:none">AVERROR_EOF</a><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap">)</span></div><div><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap"><font color="#000000">        </font></span><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(224,128,0)">return</span><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap">;</span></div><div><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap"><font color="#000000">    </font></span><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(224,128,0)">else</span><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap"> </span><span class="gmail-keywordflow" style="font-family:monospace,fixed;font-size:13px;white-space:pre-wrap;color:rgb(224,128,0)">if</span><span style="color:rgb(0,0,0);font-family:monospace,fixed;font-size:13px;white-space:pre-wrap"> (ret < 0) {</span></div><div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"> fprintf(stderr, <span class="gmail-stringliteral" style="color:rgb(0,32,128)">"Error during decoding\n"</span>);</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"> exit(1);</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"> }</div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">}</div></div><div class="gmail-line" style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:13px;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)"><br></div></div>