Skip to content

Revamp WebCodecs documentation#43697

Merged
hamishwillee merged 63 commits intomdn:mainfrom
sb2702:webcodecs-docs-1
May 8, 2026
Merged

Revamp WebCodecs documentation#43697
hamishwillee merged 63 commits intomdn:mainfrom
sb2702:webcodecs-docs-1

Conversation

@sb2702
Copy link
Copy Markdown
Contributor

@sb2702 sb2702 commented Apr 7, 2026

Description

As per this discussion, I have revamped the WebCodecs documentation by documenting the high level concepts of the core WebCodecs API, as well as adding 3 specific guides:

  • A primer on Video Processing
  • Usage guide with code examples for how to practically use the WebCodecs API
  • Codec selection guide, how to specify and choose a codec string for use in WebCodecs

Motivation

The existing WebCodecs documentation is very sparse and bare compared to other APIs. Having developed WebCodecs applications for several years, the existing docs are not sufficient as practical guides to using the API.

I built https://webcodecsfundamentals.org/, an actual real-world guide to building production WebCodecs applications, both from my experience and with contributions from other devs who've built popular WebCodecs libraries, which is already referenced in MDN and by Chrome Developer Blog and CanIUse.

The motivation for this PR is to actually put the most substantive, core WebCodecs documentation on MDN itself, including pragmatic, core bits of information such as the need to manage encoder.encodeQueueSize which is not documented anywhere, but which is critical for avoiding application crashes when working with WebCodecs.

Additional details

The underlying discussion

Related issues and pull requests

@sb2702 sb2702 requested review from a team as code owners April 7, 2026 16:48
@sb2702 sb2702 requested review from dipikabh and hamishwillee and removed request for a team April 7, 2026 16:48
@github-actions github-actions Bot added Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Preview URLs (4 pages)

Flaws (1)

Note! 3 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/API/WebCodecs_API
Title: WebCodecs API
Flaw count: 1

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Canvas which is a redirect
External URLs (36)

URL: /en-US/docs/Web/API/WebCodecs_API
Title: WebCodecs API


URL: /en-US/docs/Web/API/WebCodecs_API/Codec_selection
Title: Codec selection


URL: /en-US/docs/Web/API/WebCodecs_API/Video_processing_concepts
Title: Video processing concepts

(comment last updated: 2026-05-08 01:28:12)

Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md
Comment thread files/en-us/web/api/webcodecs_api/index.md
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md
Comment thread files/en-us/web/api/webcodecs_api/using_the_webcodecs_api/index.md
@sb2702 sb2702 requested review from Djuffin and dalecurtis April 9, 2026 04:28
Copy link
Copy Markdown
Contributor

@dalecurtis dalecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally lgtm. Thanks for doing this!

@hamishwillee
Copy link
Copy Markdown
Collaborator

I hope to look at this next week, if @dipikabh doesn't beat me to it.

Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/codec_selection/index.md
@github-actions github-actions Bot added size/xl [PR only] >1000 LoC changed and removed size/l [PR only] 501-1000 LoC changed labels Apr 23, 2026
@hamishwillee
Copy link
Copy Markdown
Collaborator

@dipikabh @wbamberg If you want to have a look and comment you are welcome to so - but please be aware that I expect to give this a final read over and likely merge on Friday.

@sb2702 I've scanned the changes you made since my last review and they look good. I'd like to scan it with all the changes in place. Should be Friday.

@dipikabh
Copy link
Copy Markdown
Contributor

dipikabh commented May 5, 2026

@hamishwillee Thanks a lot for reviewing these updates!
I won't be able to get to this, so I'll take myself off the list.

@dipikabh dipikabh removed their request for review May 5, 2026 15:59
@wbamberg wbamberg requested review from wbamberg and removed request for wbamberg May 5, 2026 16:07
@wbamberg
Copy link
Copy Markdown
Collaborator

wbamberg commented May 5, 2026

@dipikabh @wbamberg If you want to have a look and comment you are welcome to so - but please be aware that I expect to give this a final read over and likely merge on Friday.

What Dipika said. This looks like a great update and I'm sure it has had enough review.

Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/index.md Outdated
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
- PCM
- : Uncompressed audio. No quality loss, but large file sizes.

The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mdn-linter] reported by reviewdog 🐶

Suggested change
The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support).
The WebCodecs specification supports a particular set of codecs, and individual devices and browsers may only support a subset of those. Encoders and decoders must be configured with fully specified codec strings (such as `"vp09.00.40.08.00"` for VP9 or `"avc1.4d0034"` for H.264) instead of ambiguous codec names like `"vp9"` or `"h264"`. The [Codec selection guide](/en-US/docs/Web/API/WebCodecs_API/Codec_selection) provides guidance on choosing an appropriate codec string (see the [Codec Support Table](https://webcodecsfundamentals.org/datasets/codec-support-table/) (webcodecsfundamentals.org) for a complete list of codec strings and their browser support).

Comment thread files/en-us/web/api/webcodecs_api/video_processing_concepts/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/video_processing_concepts/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/video_processing_concepts/index.md Outdated
Comment thread files/en-us/web/api/webcodecs_api/video_processing_concepts/index.md Outdated
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've scan read through this again. I started doing a few minor tweaks then realized this was mosly grammar - so ran Claude as a grammar checker.

I'm not an expert by any means but this matches my understanding of the domain. The structure is good and so is the flow.

Upshot, is that I am happy with this. It is clearly much better than what it replaces. Thank you @sb2702 !!!

@hamishwillee hamishwillee merged commit 98b1f61 into mdn:main May 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/xl [PR only] >1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants