Skip to Content
Platform.Ontology

WebCodecs (video and audio encode and decode)

Gives direct access to the browser's video and audio codecs with no prompt.

Works without askingThings a page can doMediaWeb browsersWhile you use it

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

BrowserStatusFirst versionReleasedNote
ChromeSupported942021-09-21None
EdgeSupported942021-09-24None
FirefoxSupported1302024-09-03None
SafariSupported16.42023-03-27None
Safari on iPhoneSupported16.42023-03-27All iOS browsers use WebKit
Chrome on AndroidSupported942021-09-21None
Samsung InternetSupported17.02022-05-04None

How a site asks for it

APIVideoDecoder, VideoEncoder, AudioDecoder, ImageDecoder, VideoFrame
Browser compat keysapi.VideoEncoder
api.VideoDecoder
api.AudioEncoder
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
Activationnone
How long it lastsWhile objects live
How to take it backNothing to revoke (no permission is stored)
Inside an iframeAvailable in workers; no iframe flag

Typical flow

  1. Create a decoder with configure()
  2. Feed chunks
  3. 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

TypeExampleApps
gamesCloud gaming in a browser decodes the game video stream frame by frame with very little delay.Xbox Cloud Gaming, GeForce NOW
creativeA web video editor cuts, exports and previews clips using hardware encoding.Clipchamp, CapCut web
videoA video call app packs your camera into small frames for the network.Google Meet, Zoom web
liveA live streaming tool sends your webcam to viewers at very low delay.Twitch, Restream
securityA camera monitoring dashboard decodes many streams at once for a security guard.None named
adsA 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

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough 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.

On this page