<div dir="ltr"><div><div><div>Thanks for the information.  Kindly correct me if my understand is right ?<br><br></div>1)  Packet can be of any type 'I', 'P', or 'B'   that we receive from av_read_frame.   // that ie compressed packet. <br>
<br></div><div>        'I" frame represents the compete frame. <br></div><div>        'P" frame represents the delta. it requires either previous 'I' or 'P' frame. <br></div><div>        'B' frame depends  closest preceeding or following 'I' or 'P' frame<br>
<br></div><div>     So, av_read_frame ( context, packet)  <br></div><div>                    - Allocates the internal memory and keeps the compressed packet. <br></div><div>     <br></div><b>     NOTE: We should not free [  av_free_packet (packet) ] if we are using shallow copy of 'packet' . For instance<br>
</b></div><b>                keeping this pointer in the AVPacketList  to push into decoding thread. <br></b><div><div><div><br></div>2)  Whatever the frame we get  we send it to avcodec_decode_video2 (... frameFinished, packet);<br>
</div><div>     ->  This API keeps internally the previous frames required to decode.  if it has sufficient packet to decode,<br></div><div>           it decodes, and sends back saying "You got complete picture". <br>
<br></div><div><br>Kindly correct me if i am wrong?<br> </div><div><br><br><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 27, 2014 at 9:20 PM, Joshua Kordani <span dir="ltr"><<a href="mailto:jkordani@lsa2.com" target="_blank">jkordani@lsa2.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#CCCCCC"><div class="">
    <div>On 5/27/14 11:28 AM, wm4 wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>On Tue, 27 May 2014 17:10:55 +0530
sithruk sana <a href="mailto:get2jils@gmail.com" target="_blank"><get2jils@gmail.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre>thanks for the reply.

I am doing the same by queueing the packet  as described in dranger
tutorial <a href="http://dranger.com/ffmpeg/ffmpegtutorial_all.html" target="_blank">http://dranger.com/ffmpeg/ffmpegtutorial_all.html</a>
</pre>
      </blockquote>
      <pre>This tutorial is prehistoric, and following it will cause you more pain
than not. Many things in it are just wrong or uses deprecated APIs. I
recommend pretending that this tutorial doesn't exist.

Normally, libavcodec decodes one frame for one packet. But you need
to deal with "codec delay": at first you won't get any decoded frames,
even if you put in some packets. Only later (when enough frames are
queued internally), you will get 1 decoded frame for 1 packet. (You also
need to feed it null-packets at the end of the video to get the last
frames.)</pre>
    </blockquote></div>
    If I have a buffer of encoded units, which I know contains a
    complete frame of encoded input, are you saying that I may have to
    pass multiple sets of these before I receive the decoded results of
    the first buffer?<br>
    <br>
    Or are you saying that I can submit chunks of a frame's worth of
    encoded input, and (understandably) won't get a complete frame back
    until I pass in enough data for 1 frame?<br>
    <br>
    Does the term "packet" in your reply correspond to something
    specific, as in, one "packet" of h264 encoded data corresponds to
    one NALU, or do you mean, one "packet" refers to enough encoded
    data, no matter the encoder, to make one frame?<div class=""><br>
    <br>
    <blockquote type="cite">
      <pre>There are others reasons why it wouldn't output a frame. If the video
frame is "damaged", you may need to set CODEC_FLAG2_SHOW_ALL or
CODEC_FLAG_OUTPUT_CORRUPT (forgot which one) to make lavc output them.
Also, it's possible to drop frames by setting skip_frame, but you
probably don't use this.

</pre>
    </blockquote></div>
    this is useful, thank you<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Joshua Kordani<br>
  </font></span></div>

<br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div>