the Chromium logo

The Chromium Projects

Audio/Video

A starting point for becoming familiar with audio and video in the Chromium projects.

Get Connected

Slack

For more real-time questions and collaboration, please consider joining the #media slack channel.

See the main Chromium Slack page for rules and instructions on signing up, as well as tips and tricks.

Mailing Groups

For more serious technical discussions or topics with potentially broader interest, it's still best practice to send to the chromium-dev discussion group (chromium-dev@chromium.org) or, for media specific matters, the media-dev discussion group (media-dev@chromium.org).

See Technical Discussion Groups for an extensive list of available groups.

Issue Tracking

Issues are tracked in the Chromium > Internals > Media component. See the open issues query.

Documentation

The majority of the media documentation lives in the source tree, see media/README.md.

For historical reference, here's the original design doc for HTML5 audio/video.

Codec and Container Support

Chromium supports a variety of codecs and containers for content playback (decoding) and content capture (encoding), listed below.

Container formats

Codec formats

Audio

Proprietary Audio Codecs (Limited to Google Chrome)

Video

Proprietary Video Codecs (Limited to Google Chrome)

Code Locations

Chromium

Particularly Interesting Bits

How does everything get instantiated?

WebLocalFrameClient::CreateMediaPlayer() is the Blink embedder API for creating a WebMediaPlayer and passing it back to Blink. Every HTML5 audio/video element will ask the embedder to create a WebMediaPlayer.

For Chromium this is handled in RenderFrameImpl.

Build Configuration & GN Flags

Chromium currently uses the GN meta-build system for generating build files. With several exceptions, the majority of GN flags that alter the behavior of Chromium's HTML5 audio/video implementation are specified in the media_options.gni file.

ffmpeg_branding

Overrides which version of FFmpeg to use.

proprietary_codecs

Alters the list of codecs Chromium claims to support, which affects <source> and canPlayType() behavior.

How buffering works

Chromium uses a combination of range requests and an in-memory sliding window to buffer media. We have a low and high watermark that is used to determine when to purposely stall the HTTP request and when to resume the HTTP request.

It's complicated, so here's a picture:

Buffering Diagram