-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
In ffmpeg, it calls DecodeFrame2 once for each frame. However the decoded picture may not be ready immediately after the call (pDstInfo->iBufferStatus = 0). This is not a problem when B-frame decoding is not supported.
The problem comes when B-frame decoding is supported:
The last decoded non-reference B-frame (pDstInfo->iBufferStatus = 0 after the call DecodeFrame2 ) (so it is disposable) buffer could be overwritten by next decoding frame because decoder thinks no-body refers to the B-frame.
So the correct way to do in ffmpeg is to call DecodeFrameNoDelay which contains two calls of DecodeFrame2. The second call allows to release the ready non-reference B-frame to be released immediately to prevent its buffer to be overwritten by next decoding frame.
Could someone provide help regarding this issue? Maybe there is a better solution?
@mstorsjo I am wondering that the issue in your test asset https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_h264.mov. has something to do with this.
Thanks.