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

H26x Codec support updates for MediaRecorder #1174

Open
handellm opened this issue Feb 11, 2025 · 6 comments
Open

H26x Codec support updates for MediaRecorder #1174

handellm opened this issue Feb 11, 2025 · 6 comments
Assignees

Comments

@handellm
Copy link

handellm commented Feb 11, 2025

Chromium's MediaRecorder API now supports HEVC encoding, introducing the hvc1.* codec string, and adds new codecs (hev1.* and avc3.*) supporting variable resolution video in MP4.

Support for HEVC platform encoding was added in WebCodecs in Chromium M130. As a follow-up, support has been added to the MediaRecorder API in Chromium. The API now supports both MP4 and Matroska muxer types with different HEVC and H.264 mime type specifications. HEVC encoding is only supported if the user's device and operating system provide the necessary capabilities.

Request for Mozilla Position on MediaRecorder codec support

Other information

Work on the Chromium side is being tracked here.

@tomrittervg
Copy link
Contributor

As a drive-by comment - "HEVC encoding is only supported if the user's device and operating system provide the necessary capabilities." is (possibly?) adding fingerprinting surface. I'm wondering if these device capabilities are already exposed from something else (e.g. decoding support).

@jesup
Copy link
Member

jesup commented Feb 12, 2025

HW decoding support != HW encoding support (I'd bet lots more chipsets/etc support decoding than encoding), so it definitely adds a bit-ish. Perhaps many more bits if you try encoding and look at characteristics of the encoder (which are much less constrained than decoders).

@handellm
Copy link
Author

In Chrome it's already exposed with WebCodecs. Besides, there's the GPU model name accessible from WebGL which infers support.

Regarding the question regarding how much the bit says: we've found that HEVC HW encode support is be very widespread. It should be in every Intel since gen6. Close to 100% of all modernish Apple devices, and Android phones.

@handellm
Copy link
Author

... and then additionally there's MediaCapabilities and presence of profiles for H264. Not sure much new is exposed.

@jan-ivar
Copy link
Member

The explainer says: "The MediaRecorder.isTypeSupported() static method is available to check for support for the new codecs."

This seems problematic given the WebRTC WG's decision to deprecate that API a year ago.

  • WebKit standards-position:

cc @youennf

@StaZhu
Copy link

StaZhu commented Feb 15, 2025

mediaCapabilities.encodingInfo() with type = record has not been well - supported in Chromium and WebKit yet.

In Chromium’s implementation, it is behind an experimental MediaCapabilitiesEncodingInfoEnabled feature flag.

Both video.canPlayType() and MediaSource.isTypeSupported() have exactly the same problem. It is indeed a pain to implement support for these sync APIs, but I feel we can’t just say we can "deprecate" the “old” APIs directly at present.

Based on this, I think developers should still be recommended to use MediaRecorder.isTypeSupport at present. It's still too early to switch to the mediaCapabilities API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs proposed position
Development

No branches or pull requests

6 participants