{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/containers/webm",
  "collection": "docs",
  "title": "WebM",
  "description": "WebM is a restricted Matroska profile for the web, limited to VP8, VP9 and AV1 video, Vorbis and Opus audio, and WebVTT subtitles.",
  "canonicalUrl": "https://encode.wiki/containers/webm/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/containers/webm.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/containers/webm.md",
  "status": "current",
  "tags": [
    "containers",
    "web"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "WebM container guidelines",
      "url": "https://www.webmproject.org/docs/container/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "WebM guidelines for VP9",
      "url": "https://www.webmproject.org/vp9/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "FFmpeg formats documentation — matroska and webm muxers",
      "url": "https://ffmpeg.org/ffmpeg-formats.html#matroska",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MKVToolNix mkvmerge manual",
      "url": "https://mkvtoolnix.download/doc/mkvmerge.html",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "headings": [
    {
      "depth": 2,
      "text": "What can go in a WebM",
      "anchor": "what-can-go-in-a-webm"
    },
    {
      "depth": 2,
      "text": "Encode to WebM",
      "anchor": "encode-to-webm"
    },
    {
      "depth": 2,
      "text": "Subtitles",
      "anchor": "subtitles"
    },
    {
      "depth": 2,
      "text": "Browser support",
      "anchor": "browser-support"
    },
    {
      "depth": 2,
      "text": "Pitfalls",
      "anchor": "pitfalls"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/containers/webm/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/_preamble.md",
      "checksum": "6479279ea9e733c4d7b2ae6a326a22c61460bd8cbc957d150e8924dcb1274ee3",
      "bytes": 292
    },
    {
      "id": "what-can-go-in-a-webm",
      "title": "What can go in a WebM",
      "depth": 2,
      "anchor": "what-can-go-in-a-webm",
      "canonicalUrl": "https://encode.wiki/containers/webm/#what-can-go-in-a-webm",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/what-can-go-in-a-webm.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/what-can-go-in-a-webm.md",
      "checksum": "659316833ba29d96b6d5ed4030688d07fae014db9208b1f3d75685e8934e5c05",
      "bytes": 1701
    },
    {
      "id": "encode-to-webm",
      "title": "Encode to WebM",
      "depth": 2,
      "anchor": "encode-to-webm",
      "canonicalUrl": "https://encode.wiki/containers/webm/#encode-to-webm",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/encode-to-webm.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/encode-to-webm.md",
      "checksum": "48a831232af7ff262eb684bd8b991524b111289b4dbe61df1aee04cec41bd262",
      "bytes": 503
    },
    {
      "id": "subtitles",
      "title": "Subtitles",
      "depth": 2,
      "anchor": "subtitles",
      "canonicalUrl": "https://encode.wiki/containers/webm/#subtitles",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/subtitles.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/subtitles.md",
      "checksum": "1e8454b345ad38b20595bef30d0b3e29aaa175c659e5c0558f8363329f4cf34f",
      "bytes": 378
    },
    {
      "id": "browser-support",
      "title": "Browser support",
      "depth": 2,
      "anchor": "browser-support",
      "canonicalUrl": "https://encode.wiki/containers/webm/#browser-support",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/browser-support.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/browser-support.md",
      "checksum": "2d8dde2e8196545b21eac4cb13ba2a67cedc5cb61763d3d7cdba6f85fa450745",
      "bytes": 349
    },
    {
      "id": "pitfalls",
      "title": "Pitfalls",
      "depth": 2,
      "anchor": "pitfalls",
      "canonicalUrl": "https://encode.wiki/containers/webm/#pitfalls",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/pitfalls.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/webm/pitfalls.md",
      "checksum": "fb1b973f225af3b6d5033fe30f4a2762efc1ba7aa38a3c472e511bed326ca788",
      "bytes": 286
    }
  ],
  "outboundReferences": [
    "/api/v1/catalog.json",
    "/codecs/audio/opus/",
    "/codecs/subtitles/webvtt/",
    "/codecs/video/av1/",
    "/codecs/video/vp8/",
    "/codecs/video/vp9/",
    "/containers/matroska/",
    "/containers/mp4/",
    "https://caniuse.com/webm",
    "https://www.matroska.org/technical/codec_specs.html",
    "https://www.webmproject.org/docs/container/"
  ],
  "checksum": "cbf32df80b36bb17b1945998f9d48c0a3247834f2ca18db6d1e2d9eea2393f55",
  "contentFormat": "markdown",
  "markdown": "WebM is [Matroska](/containers/matroska/) restricted to a small royalty-free set of codecs so that every browser can play it. It is what you use for video on the web that is not H.264 and AAC in [MP4](/containers/mp4/). Every WebM file is valid Matroska, but not every Matroska file is WebM.\n\n## What can go in a WebM\n\n| Type      | Allowed       |\n| --------- | ------------- |\n| Video     | VP8, VP9, AV1 |\n| Audio     | Vorbis, Opus  |\n| Subtitles | WebVTT        |\n\nNothing else is allowed: no H.264 or HEVC, no AAC or MP3, no SRT or ASS. FFmpeg's muxer enforces this and refuses to write the file otherwise (\"Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM\"). If you want those streams, use MKV or MP4.\n\n**Codecs documented for WebM on this wiki**\n\n| Relationship | Project or format | Evidence and scope | Status |\n| --- | --- | --- | --- |\n| Carried By by | [AV1](/codecs/video/av1/) | AV1-in-WebM is implemented in common tools, but the current public WebM codec list does not document it. Scope: Container Mapping. Sources: [WebM container guidelines](https://www.webmproject.org/docs/container/), [Matroska codec mappings](https://www.matroska.org/technical/codec_specs.html). | Common Implementation |\n| Carried By by | [Opus](/codecs/audio/opus/) | Opus is one of the audio codecs listed by the WebM Project. Scope: Container Mapping. Sources: [WebM container guidelines](https://www.webmproject.org/docs/container/). | Documented |\n| Carried By by | [VP8](/codecs/video/vp8/) | WebM's documented codec subset includes VP8. Scope: Container Subset. Sources: [WebM container guidelines](https://www.webmproject.org/docs/container/). | Documented |\n| Carried By by | [VP9](/codecs/video/vp9/) | WebM's documented codec subset includes VP9. Scope: Container Subset. Sources: [WebM container guidelines](https://www.webmproject.org/docs/container/). | Documented |\n\n[Open the complete typed relationship catalog](/api/v1/catalog.json).\n\n## Encode to WebM\n\n```sh\nffmpeg -i input.mkv -c:v libvpx-vp9 -crf 32 -b:v 0 -row-mt 1 -c:a libopus -b:a 128k output.webm\nffmpeg -i input.mkv -c:v libsvtav1 -crf 32 -c:a libopus -b:a 128k output.webm\n```\n\nSee [VP9](/codecs/video/vp9/), [AV1](/codecs/video/av1/) and [Opus](/codecs/audio/opus/) for encoder settings. If the source is already VP9/AV1 and Opus, a remux is enough: `ffmpeg -i input.mkv -c copy output.webm`. `mkvmerge -o output.webm input.mkv` also writes a WebM when the content qualifies.\n\n## Subtitles\n\nWebM only carries WebVTT. Convert SRT during muxing:\n\n```sh\nffmpeg -i input.mkv -i subs.srt -map 0 -map 1 -c copy -c:s webvtt output.webm\n```\n\nWebVTT inside a WebM is mainly useful for desktop players such as mpv and VLC. For web pages, ship a separate `.vtt` file referenced with a `<track>` element, as described on the [WebVTT](/codecs/subtitles/webvtt/) page.\n\n## Browser support\n\nChrome, Firefox and Edge play every WebM codec, AV1 included (they ship a software AV1 decoder). Safari's WebM support depends on version and device, and it decodes AV1 only on hardware that has an AV1 decoder (A17 Pro, M3 and later). Check [Can I use](https://caniuse.com/webm) and [AV1](/codecs/video/av1/) for current status.\n\n## Pitfalls\n\n- **Do not rename MKV to WebM.** A file with H.264 or AAC inside is not a valid WebM and browsers will refuse or mis-handle it.\n- **Live or DASH output.** FFmpeg's WebM muxer has `-live 1` for live streams and `-dash 1` for WebM DASH segments; a normal file needs neither.\n"
}
