Skip to content

WebCodecs API

Published

WebCodecs API — The WebCodecs API gives web apps low-level, hardware-accelerated access to encode and decode individual video frames and audio chunks via VideoEncoder, VideoDecoder, AudioEncoder, and AudioDecoder.

  • Legend
  • Yes
  • Partial
  • Flag
  • No
  • Unknown
Browser / PlatformSupportVersionsConfidenceSourceNotes
Chrome (Desktop)Yes94highsource1
Chrome (Android)Yes94highsource23
Edge (Desktop)Yes94highsource45
Firefox (Desktop)Yes130highsource6
Firefox (Android)No—highsource78
Safari (macOS)Yes16.4highsource9
Safari (iOS)Yes16.4highsource1011
Samsung InternetYes17.0highsource1213
WebView (Android)Yes94highsource1415
Chrome (Desktop)Yes94highsource16
Chrome (Android)Yes94highsource1718
Edge (Desktop)Yes94highsource1920
Firefox (Desktop)Yes130highsource21
Firefox (Android)No—highsource2223
Safari (macOS)Yes26highsource24
Safari (iOS)Yes26highsource2526
Samsung InternetYes17.0highsource2728
WebView (Android)Yes94highsource2930
  1. Covers the `VideoDecoder` entry.
  2. Covers the `VideoDecoder` entry.
  3. Derived by browser-compat-data mirroring from Chrome.
  4. Covers the `VideoDecoder` entry.
  5. Derived by browser-compat-data mirroring from Chrome.
  6. Covers the `VideoDecoder` entry.
  7. Covers the `VideoDecoder` entry.
  8. No Firefox for Android support is recorded in browser-compat-data.
  9. Covers the `VideoDecoder` entry.
  10. Covers the `VideoDecoder` entry.
  11. Derived by browser-compat-data mirroring from Safari.
  12. Covers the `VideoDecoder` entry.
  13. Derived by browser-compat-data mirroring from Chrome Android.
  14. Covers the `VideoDecoder` entry.
  15. Derived by browser-compat-data mirroring from Chrome Android.
  16. Covers the `AudioDecoder` entry.
  17. Covers the `AudioDecoder` entry.
  18. Derived by browser-compat-data mirroring from Chrome.
  19. Covers the `AudioDecoder` entry.
  20. Derived by browser-compat-data mirroring from Chrome.
  21. Covers the `AudioDecoder` entry.
  22. Covers the `AudioDecoder` entry.
  23. No Firefox for Android support is recorded in browser-compat-data.
  24. Covers the `AudioDecoder` entry.
  25. Covers the `AudioDecoder` entry.
  26. Derived by browser-compat-data mirroring from Safari.
  27. Covers the `AudioDecoder` entry.
  28. Derived by browser-compat-data mirroring from Chrome Android.
  29. Covers the `AudioDecoder` entry.
  30. Derived by browser-compat-data mirroring from Chrome Android.

Source data: /compatibility/webcodecs.json · Global usage: 92 % (StatCounter 2026-05)

Source: spec · MDN · Last verified 2026-10-03 · Confidence: high (computed from sources)

VideoDecoder takes an output callback for each decoded frame and an error callback, then decodes chunks you feed it via decode():

function createVideoDecoder(onFrame) {
const decoder = new VideoDecoder({
output: (frame) => {
onFrame(frame);
frame.close();
},
error: (e) => console.error(e),
});
return decoder;
}

Check for VideoDecoder before creating one. When it is absent, disable the frame-by-frame feature and show that it is unavailable:

if ('VideoDecoder' in window) {
enableFrameByFrameProcessing();
} else {
disableFrameByFrameProcessing();
showFrameByFrameUnavailableMessage();
}
  • VideoFrame and AudioData objects reference-count their underlying media resources — call close() on each one as soon as you are done with it. For output VideoFrames owned by a VideoDecoder, waiting on garbage collection to reclaim them can stall further decoding.
  • Safari shipped VideoDecoder support starting in Safari 16.4; feature-detect the specific interface you need rather than assuming other WebCodecs interfaces ship on the same schedule.
  • Firefox added VideoDecoder on desktop in Firefox 130, but that addition did not extend to Firefox for Android, so VideoDecoder is undefined there.
  • An unsupported or invalid codec string does not make configure() reject a promise — configure() closes the decoder and delivers a NotSupportedError to its error callback, or throws a synchronous TypeError if the config fails validation. Always pass the fully-qualified codec string your source media actually uses.

For the full reference (worker usage and the fully-specified codec-string requirement), see WebCodecs: low-level, hardware-accelerated audio and video encoding.

See also WebGPU.

← Back to the Compatibility explorer.