Hi Michael -- after reading into things a bit more, I agree that it's risky what I'm doing. However, I only need about 3 frames per second so maybe waiting for a key frame isn't the end of the world...
Is there a safer way? The decoding is extremely expensive so I only want to do it when I absolutely need to. Thanks! On Tue, Jun 26, 2012 at 11:44 AM, Michael Bradshaw < [email protected]> wrote: > On Tue, Jun 26, 2012 at 12:34 PM, Simon Daniels > <[email protected]> wrote: > > // Is this a packet from the video stream? > > if (packet.stream_index == videoStreamIndex && frameLocation++ % > frameSkip > > == 0) > > { > > // Decode video frame > > avcodec_decode_video2(pCodecCtx, pFrameYUV, &isFrameFinished, &packet); > > You don't want to be doing it like this, I don't think. If there are B > frames in the video, this could really mess things up (because frame 2 > could depend on decoding frame 1 just before it, but you skipped > decoding frame 1, so now frame 2 is junk/gets decoded wrong (and now > all the ones decoded after it will be junk frames too until you hit a > keyframe)). > _______________________________________________ > Libav-user mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/libav-user >
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
