-
Notifications
You must be signed in to change notification settings - Fork 134
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
Video h264 decoder supports both Annex B and AVCC format #72
Comments
AVC format:
Annex B format:
For WebCodecs, the configuration difference is probably the most important. The current design expects all configuration changes to be explicit; if we require apps to detect and extract Annex B configuration changes, then we may as well require them to convert to AVC format at the same time. Other options include supporting Annex B but rejecting streams with in-band configuration changes, or supporting Annex B with a new configuration model. |
Most typical Annex B in-band configuration change is video resolution, for adaptive bitrate streaming. Usually video decoders are able to handle it silently. If unlucky the in-band configuration change was not supported by decoder (perhaps profile change), throw an exception for re-configure decoder and continually decoding with new configuration. This case should be very seldom. |
Latest thinking is we should add some field to the config to describe which format is desired. |
For what it's worth, the MediaRecorder in Google Chrome generates Annex B style data streams. When asked to generate MIME types like Each of those simple blocks contains a sequence of complete AVC NALUs (sometimes just one, sometimes several). They're separated by Annex B style It's not hard to convert the start-code format to the byte-length format. But it would be nice if the decoder ate both. |
For those following along, the linked PR #117 solves format selection for encoding, but not decoding. For decoding, my thinking is to simply signal your preferred format by including/excluding the avcc via the VideoDecoderConfig.description. No avcc implies annex-b format. |
Agreed it is not hard to implement Annex B to avcC conversion in js. I have already implemented one and works well. As @sandersdan suggested previously, how does the decoder handle adaptive video streaming (dynamic resolution) properly with these two formats? Does WebCodecs allow silent configure change?
|
My expectations are:
|
The VideoEncoder and VideoDecoder reconfiguration is expected to be the same procedure. It will be good if VideoEncoder also supports reconfiguration in this way.
https://github.com/WICG/web-codecs/blob/master/explainer.md#codec-configuration |
It does.
That's fair, the explainer has not been kept up-to-date with changes in the draft spec. We should probably just cut a lot of detail out of it and refer to the spec instead. |
Both are very popular and used in different scenarios. Let application to choose the format during decoder configuration.
The text was updated successfully, but these errors were encountered: