[Libav-user] Frames are not visually lining up between my code and ffmpeg.exe

Simon Daniels simondaniels23 at gmail.com
Tue Jun 26 21:11:18 CEST 2012


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 <
mbradshaw at sorensonmedia.com> wrote:

> On Tue, Jun 26, 2012 at 12:34 PM, Simon Daniels
> <simondaniels23 at gmail.com> 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
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120626/6719387d/attachment.html>


More information about the Libav-user mailing list