[Libav-user] avcodec_decode_video2 missing the first 8 frames

Matt Orlando morlando616 at gmail.com
Wed Jul 23 18:51:56 CEST 2014


Hey folks, I've got it working!  I appreciate all the help you guys
provided...it turns out the last thing wm4 had mentioned was the problem.
 Once the stream hit the EOF, I kept processing frames with null/0 packets
until it was finished and that fed me the remaining frames.


On Tue, Jul 22, 2014 at 7:15 PM, wm4 <nfxjfg at googlemail.com> wrote:

> On Mon, 21 Jul 2014 12:37:45 -0400
> Matt Orlando <morlando616 at gmail.com> wrote:
>
> > Hi folks,
> >
> > I'm having some trouble with the decoding of my h.264 movies.  I've
> tested
> > with different videos, one 64 frames long and another 52 frames long.  In
> > both cases, the first 8 frames (exactly 8) weren't decoding.  In other
> > words, the call to avcodec_decode_video2 returns 0 for the got_picture
>
> I think never libavcodec versions skip broken frames (frames that could
> not be properly decoded, and which may contain garbage). You can set the
> CODEC_FLAG2_SHOW_ALL flag to enable output of them.
>
> Also keep in mind that the first frames may not produce any output,
> because the decoder buffers them internally. This is needed for
> B-frames (some frames can reference future frames, so you obviously
> can get them until these future frames are decoded), or for
> multithreading (each thread incurs an additional delay). When you have
> no more packets, you need to send flush packets (data/size set to 0) to
> get the last frames.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140723/34ad12d7/attachment.html>


More information about the Libav-user mailing list