Skip to content
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: Add avc3 and hev1 muxer support for MediaRecorder #49675

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 13, 2024

Background: Safari initially supported avc1 mp4 recording. Then,
Chrome added avc1 support since version M126 this year. The benefit
of avc1 is that it is the only H.264 tag natively supported by
Apple devices. The same situation applies to hvc1.

However, there are some limitations for avc1 and hvc1. That is,
they only allow "out of band" parameter sets and cannot change
parameter sets during encoding. So, if the capture device can
produce a video stream with a dynamically changing resolution,
then only avc3 and hev1 can satisfy the needs as they support
"in band" parameter sets so muxer can insert parameter sets into
the bitstream if they are changed.

This CL extends the existing H264AnnexBToAvcBitstreamConverter
and H265AnnexBToHevcBitstreamConverter by adding a property to
allow control the insertion of parameter sets into the bitstream.
Also wire the Mp4MuxerDelegateto write correct tag based on
the settings.

Bug: 381179823
Bug: 40276507
Change-Id: I6d104546e9cf46b18fae4dc1fd8af1124b918e7c
Reviewed-on: https://chromium-review.googlesource.com/6079351
WPT-Export-Revision: 4c012983f626e69ce0aa76a42709164d0ca03541

Background: Safari initially supported `avc1` mp4 recording. Then,
Chrome added avc1 support since version M126 this year. The benefit
of `avc1` is that it is the only H.264 tag natively supported by
Apple devices. The same situation applies to `hvc1`.

However, there are some limitations for `avc1` and `hvc1`. That is,
they only allow "out of band" parameter sets and cannot change
parameter sets during encoding. So, if the capture device can
produce a video stream with a dynamically changing resolution,
then only `avc3` and `hev1` can satisfy the needs as they support
"in band" parameter sets so muxer can insert parameter sets into
the bitstream if they are changed.

This CL extends the existing `H264AnnexBToAvcBitstreamConverter`
and `H265AnnexBToHevcBitstreamConverter` by adding a property to
allow control the insertion of parameter sets into the bitstream.
Also wire the `Mp4MuxerDelegate`to write correct tag based on
the settings.

Bug: 381179823
Bug: 40276507
Change-Id: I6d104546e9cf46b18fae4dc1fd8af1124b918e7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants