WebCodecs (video and audio encode and decode)
Gives direct access to the browser's video and audio codecs with no prompt.
In one line
Can open and make video and sound files by itself inside the page
Gives direct access to the browser's video and audio codecs with no prompt.
A site can encode or decode media frames in code, often with hardware acceleration. Great for editors, but also lets a page probe which codecs and accelerators the device has.
What it can and can't do
What the user does: Nothing. It happens when the page plays, edits or records media.
It can
- Decode video and audio frame by frame
- Make new video or audio files in the page
- Use your device's chip to speed up video
It cannot
- Turn on your camera or microphone without a permission pop up
- Go past what your device's chip can handle
- Work on files it was not given
- Run after you close the page
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 94 | 2021-09-21 | None |
| Edge | Supported | 94 | 2021-09-24 | None |
| Firefox | Supported | 130 | 2024-09-03 | None |
| Safari | Supported | 16.4 | 2023-03-27 | None |
| Safari on iPhone | Supported | 16.4 | 2023-03-27 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 94 | 2021-09-21 | None |
| Samsung Internet | Supported | 17.0 | 2022-05-04 | None |
How a site asks for it
| API | VideoDecoder, VideoEncoder, AudioDecoder, ImageDecoder, VideoFrame |
| Browser compat keys | api.VideoEncoderapi.VideoDecoderapi.AudioEncoder |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | While objects live |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Available in workers; no iframe flag |
Typical flow
- Create a decoder with configure()
- Feed chunks
- Receive VideoFrame objects
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- isConfigSupported() reveals codec and hardware support (fingerprint)
- Hardware decoder instances are limited by the platform (a few at once on many devices)
- Frames must be closed (VideoFrame.close()) or memory fills quickly
- Safari support arrived at 16.4 for video; AudioEncoder later
- No access to camera without getUserMedia
The story
What it is
A page can use your device's video and sound chips directly to pack and unpack media.
For you
You never see it. Web video editors, cloud games and calls just look sharper and use less battery, because the page uses hardware built for video.
For makers
Makers get fast video processing without a plugin: custom players, editing, streaming with very low delay. It turns a tab into a serious media tool.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | Cloud gaming in a browser decodes the game video stream frame by frame with very little delay. | Xbox Cloud Gaming, GeForce NOW |
| creative | A web video editor cuts, exports and previews clips using hardware encoding. | Clipchamp, CapCut web |
| video | A video call app packs your camera into small frames for the network. | Google Meet, Zoom web |
| live | A live streaming tool sends your webcam to viewers at very low delay. | Twitch, Restream |
| security | A camera monitoring dashboard decodes many streams at once for a security guard. | None named |
| ads | A video ad player decodes ads with exact timing, so the ad counts as viewed. | None named |
Risks
- Heavy battery use
- Used to hide video fingerprints
What the platform says
- Google: WebCodecs. Chrome's docs say WebCodecs gives low level control over video and audio encoding and decoding in the browser.
Good uses and abuse
Legitimate uses
- Video editors
- Cloud gaming
- Transcoding in browser
Known abuse
- Codec capability fingerprinting
- Covert hardware load
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
History
- 2021-09, Chrome 94: WebCodecs ships
- 2023-03, Safari 16.4: VideoDecoder and VideoEncoder
- 2024-09, Firefox 130: WebCodecs on desktop
Sources
How well checked: Based on official documentation.