Page MenuHome

Fix T91405: Block artefacts in WEBM video
AbandonedPublic

Authored by Richard Antalik (ISS) on Nov 3 2021, 3:22 AM.

Details

Summary

Issue was caused by incorrect FFmpeg asynchronous decoding API. In most
cases, decoder returns 1 frame each time it is fed by 1 packet. Here
decoder wanted to return more frames, but our code always expected only
one.

Add buffer for frame storage.

Now decoding follows this scheme:

  • Feed decoder by 1 packet
  • Try to get frame
  • If frame is ready, use it as usual, but try to get more frames in loop and store them in buffer.
  • If frame is not ready, quit. Since decoding is run in loop, eventually frame will be returned, unless error occurs.

I think this could be simplified by not using any buffer, will make separate patch for this. Or if it turns out to be terrible idea I will mention this.
This bug originates in 2.93, so it should be discussed if this should be backported to LTS, I think for 3.0 this is fairly safe.

Diff Detail

Repository
rB Blender
Branch
T91405_1 (branched from master)
Build Status
Buildable 18413
Build 18413: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.Nov 3 2021, 3:22 AM
Richard Antalik (ISS) created this revision.

Ok, D13079 seems to be much straightforward solution... I tried to be clever. So closing this patch