Hardware acceleration and fingerprinting
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript
- Bereich
- api, audio-video-rtc
Rechercherichtung
Beginne mit dem Abschnitt zur Hardwarebeschleunigung der WebCodecs-Spezifikation und dem Beispiel für VideoEncoder.isConfigSupported, und überprüfe anschließend den verknüpften Bugzilla-Bericht sowie die beiden bestehenden Kommentare. Das Issue ist abgeschlossen, wenn das Verhalten von hardwareAcceleration unter Fingerprinting-Einschränkungen und das beobachtbare Ergebnis für Autoren vereinbart und spezifiziert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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:
VideoEncoder.isConfigSupported({
codec: "av01.0.08M.08",
width: 1280,
height: 720,
hardwareAcceleration: "prefer-hardware",
}).then(console.log)
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 a User Agent does not implement [media-capabilities] for reasons of fingerprinting, they SHOULD ignore the HardwareAcceleration preference
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:
- Don't return
hardwareAccelerationin the config returned by isConfigSupported. Unfortunately, this isn't quite correct, ashardwareAccelerationis 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?
- Vorherrschende Sprache
- HTML
- Sterne
- 1.3k
- Forks
- 190
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus w3c/webcodecs
-
privacy-needs-resolution
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
editorial
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
w3c/webcodecs#983 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
w3c/webcodecs#978 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
w3c/webcodecs#977 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
backend bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
PoCInnovation/Distribox#255 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug-report bug-report-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Codeinwp/wp-menu-icons#354 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
google/langextract#598 ·
Maintainer antworten meist innerhalb von 1 Tag