-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding "out of order" video frames (B-frames) #7
Comments
Why does WebCodecs need to do anything? In the same implementation, is it likely that the encoder for a B-frames codec (say h264) would generate a bitstream that the decoder wouldn't be able to handle? I suppose there are some implementations with software encoders and hardware decoders. Is that what you were thinking? |
It impacts two things:
|
I used to implement and develop H.264/AVC software encoder at my former job.
A decoder doesn't need a timestamp for reordering frames which includes B-frames. Because each coded frame has
I'm not sure about decoder implementation in detail. But I think decoder could output immediately a frame if it is output order. Anyway, container should take care of timing for decoding and presenting.
I think it depends on the encoder capability. Encoder will decide which frame type should be used in the end. (e.g. IDR:IDR, I:I, P:I/P, B:I/P/B) |
The main limitation we have here is that not all platform decoders have the option to output frames in decode order. The common denominator then is that WebCodecs video decoders should output frames in presentation order. Some implementations would need to buffer out-of-order frames to make that happen. |
I think that in case we support b-frames in both encoder/decoders, the frames should be output in encoding/decoding order and have a TransformStream that reorders them
We should add |
I think that it is difficult to take a presentation number from decoding order frames. It will not be able to find a number of frames between reference frames... A limitation size of buffering out-of-order frames must be specified by each codec specification. |
As others have pointed out, #55 is basically a duplicate of this, but with more current insights and more recent feedback. Closing this one in favor of that.
This is tracked in greater detail by #57 |
Many video codecs support B-frames, frames which have dependencies on previous and future (chronological) frames. Some decoders want to be fed packet in the decoder order (e.g., the future I-frame is fed before the B-frame that depends on it) while others will take care of buffering and reordering internally.
This is a tracking issue for sketching how the WebCodecs API supports B-frames.
The text was updated successfully, but these errors were encountered: