On Fri, Aug 29, 2014 at 8:19 AM, wm4 <[email protected]> wrote: > On Thu, 28 Aug 2014 16:42:50 -0400 > Krishna <[email protected]> wrote: > > > Thanks Markus and wm4. I gave your suggestion a shot and this is what I > > did. In my situation, I call the decoder() and expect a frame. However, > the > > decoder will buffer several packets right in the beginning. Since I need > a > > single frame per call, I now keep track of the number of times it read > > packets without decoding (in the beginning). I call this > "numInitPackets". > > > > In the end I flush out that many packets using a null packet. And it > > worked! Thank you so much for your help! > > ah thank you. didnt know that one. but makes sense yes. > > You don't need a counter. Once you have no more packets, you start > feeding the decoder null packets. And once the decoder doesn't return a > new picture, even though you fed it a null packet, you know there are no > more frames in the decoder. > _______________________________________________ > Libav-user mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/libav-user >
[sorry for the late reply] You are spot-on wm4! I got back to work today and tried what you suggested. I examined the value of "gotFrame" in avcodec_decode_video2() and when it is longer "1", it means that the frames have been fully flushed. This works! Thanks everyone for your help on this! -- Regards, Krishna
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
