You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just filed a bug on Bugzilla but what Firefox is doing is spec compliant, so I wanted to raise the issue here too.
Background
I'm making a website that heavily utilizes WebCodecs. I need to determine the encoding codec and always want to use hardware encoding (when available) as battery life is more important than fidelity (conference call).
Loop through all codecs in order of network efficiency: av1, vp9, hevc, h254, vp8, etc
Check if the browser supports hardware acceleration, if so return it.
Repeat the loop but this time with software acceleration.
I'm using the hardwareAcceleration: "prefer-hardware" field to determine if hardware acceleration is supported. Here's an example of one of the checks:
Here's a little modal I created to visualize the process and the results on my M2 laptop and Chrome.
Problem
Here's what Firefox reports:
Ignore the partial support for video capture (MediaStreamTrackProcessor polyfill).
The problem is that Firefox is reporting hardware acceleration for AV1, VP9, etc. So my encoder will naively select one of those codecs and suddenly my CPU is on fire.
My guess is that Firefox is ignoring the hardwareAcceleration field to avoid fingerprinting. Here's the relevant section in the specification:
If the browser won't respect hardwareAcceleration because it can be used for fingerprinting, then the browser should return an error somehow. I don't think the browser should silently ignore important configuration values without feedback.
If I knew that Firefox doesn't allow probing for hardware acceleration, then I would use H.264 because hardware acceleration is very common and easier on the CPU. Then I could also report hardware acceleration as "unknown" and maybe show a modal explaining why performance might be poor.
My suggestions:
Don't return hardwareAcceleration in the config returned by isConfigSupported. Unfortunately, this isn't quite correct, as hardwareAccelerationis supported but only as a hint.
Add "require-hardware" and "require-software" as options, throwing an exception (or returning false?) if they are used on browsers that care about fingerprinting.
Firefox pls allow me to detect hardware acceleration. Otherwise I can't use newer codecs for fear of melting silicon.
I think #2 is the best option. It's kind of strange that Chrome returns isConfigSupported=false when "prefer-hardware" is used. If it's just a hint, like the "prefer" implies, then it should always return true if either software or hardware encoding is available... right?
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I just filed a bug on Bugzilla but what Firefox is doing is spec compliant, so I wanted to raise the issue here too.
Background
I'm making a website that heavily utilizes WebCodecs. I need to determine the encoding codec and always want to use hardware encoding (when available) as battery life is more important than fidelity (conference call).
I'm using the
hardwareAcceleration: "prefer-hardware"
field to determine if hardware acceleration is supported. Here's an example of one of the checks:Here's a little modal I created to visualize the process and the results on my M2 laptop and Chrome.
Problem
Here's what Firefox reports:
Ignore the partial support for video capture (
MediaStreamTrackProcessor
polyfill).The problem is that Firefox is reporting hardware acceleration for AV1, VP9, etc. So my encoder will naively select one of those codecs and suddenly my CPU is on fire.
My guess is that Firefox is ignoring the
hardwareAcceleration
field to avoid fingerprinting. Here's the relevant section in the specification:Proposed
If the browser won't respect
hardwareAcceleration
because it can be used for fingerprinting, then the browser should return an error somehow. I don't think the browser should silently ignore important configuration values without feedback.If I knew that Firefox doesn't allow probing for hardware acceleration, then I would use H.264 because hardware acceleration is very common and easier on the CPU. Then I could also report hardware acceleration as "unknown" and maybe show a modal explaining why performance might be poor.
My suggestions:
hardwareAcceleration
in the config returned by isConfigSupported. Unfortunately, this isn't quite correct, ashardwareAcceleration
is supported but only as a hint."require-hardware"
and"require-software"
as options, throwing an exception (or returning false?) if they are used on browsers that care about fingerprinting.I think #2 is the best option. It's kind of strange that Chrome returns
isConfigSupported=false
when"prefer-hardware"
is used. If it's just a hint, like the "prefer" implies, then it should always return true if either software or hardware encoding is available... right?The text was updated successfully, but these errors were encountered: