{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/containers",
  "collection": "docs",
  "title": "Containers overview",
  "description": "What a media container does, how MKV, MP4, WebM, MOV, Ogg and AVI differ, and how to pick one.",
  "canonicalUrl": "https://encode.wiki/containers/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/containers.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/containers.md",
  "status": "current",
  "tags": [
    "containers",
    "overview"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "RFC 9559 — Matroska Media Container Format Specification",
      "url": "https://datatracker.ietf.org/doc/rfc9559/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "ISO/IEC 14496-12 — ISO Base Media File Format",
      "url": "https://www.iso.org/standard/85596.html",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "MP4 Registration Authority",
      "url": "https://mp4ra.org/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "headings": [
    {
      "depth": 2,
      "text": "Which container should I use?",
      "anchor": "which-container-should-i-use"
    },
    {
      "depth": 2,
      "text": "Remuxing",
      "anchor": "remuxing"
    },
    {
      "depth": 2,
      "text": "What containers do not do",
      "anchor": "what-containers-do-not-do"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/containers/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/_preamble.md",
      "checksum": "940e2dd41761b4b1d01773ed294dfa596295389abf955417c886e21ee975fe33",
      "bytes": 396
    },
    {
      "id": "which-container-should-i-use",
      "title": "Which container should I use?",
      "depth": 2,
      "anchor": "which-container-should-i-use",
      "canonicalUrl": "https://encode.wiki/containers/#which-container-should-i-use",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/which-container-should-i-use.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/which-container-should-i-use.md",
      "checksum": "0fb2511422be9962a7f77b09967ba221856a9316b6789c0fd23004da70691cac",
      "bytes": 2009
    },
    {
      "id": "remuxing",
      "title": "Remuxing",
      "depth": 2,
      "anchor": "remuxing",
      "canonicalUrl": "https://encode.wiki/containers/#remuxing",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/remuxing.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/remuxing.md",
      "checksum": "b5ffa1c09faa987d96cccaf87cd304ab8c31bf655860e14ae7fa47480fdae760",
      "bytes": 573
    },
    {
      "id": "what-containers-do-not-do",
      "title": "What containers do not do",
      "depth": 2,
      "anchor": "what-containers-do-not-do",
      "canonicalUrl": "https://encode.wiki/containers/#what-containers-do-not-do",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/what-containers-do-not-do.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/what-containers-do-not-do.md",
      "checksum": "6103c8cf1d1e0cc42dc5b6073875fefc09f237ac7956df48075f4b9f220af257",
      "bytes": 544
    }
  ],
  "outboundReferences": [
    "/codecs/subtitles/",
    "/containers/avi/",
    "/containers/isobmff/",
    "/containers/matroska/",
    "/containers/mov/",
    "/containers/mp4/",
    "/containers/ogg/",
    "/containers/webm/",
    "/guides/audio-and-subtitles/",
    "/guides/preserve-color-and-hdr/"
  ],
  "checksum": "a6f03b3a1b447ec6e28b0debc5bff4cf91b87423be9f612d737c28a25eb16422",
  "contentFormat": "markdown",
  "markdown": "A container (or \"muxer format\") is the file that holds your encoded video, audio, subtitles, chapters and metadata together and keeps them in sync. It does not change quality: moving streams between containers is a **remux** and, with `-c copy`, is lossless and takes seconds. The file extension is only a label; what matters is which streams are inside and whether your player understands them.\n\n## Which container should I use?\n\n| Container                         | Extensions              | Use it for                                                                        | Watch out for                                                     |\n| --------------------------------- | ----------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------- |\n| [Matroska](/containers/matroska/) | `.mkv`, `.mka`, `.mks`  | Archives and releases: any codec, many tracks, ASS/PGS subtitles, fonts, chapters | Not accepted by most phones, TVs and web browsers                 |\n| [MP4](/containers/mp4/)           | `.mp4`, `.m4a`, `.m4v`  | Sharing, web, phones, TVs, streaming                                              | Text subtitles only as `mov_text`; no ASS or PGS                  |\n| [WebM](/containers/webm/)         | `.webm`                 | Browser playback with VP8/VP9/AV1 and Vorbis/Opus                                 | Nothing else fits: no H.264, AAC or SRT                           |\n| [MOV](/containers/mov/)           | `.mov`                  | Editing and mezzanine files (ProRes, DNxHR), Apple workflows                      | Looks like MP4 but accepts codecs MP4 players may not             |\n| [Ogg](/containers/ogg/)           | `.ogg`, `.oga`, `.opus` | Opus, Vorbis and FLAC audio; Theora video                                         | Poor video container; `.opus` is Opus in Ogg                      |\n| [AVI](/containers/avi/)           | `.avi`                  | Playing old files                                                                 | No real timestamps, no modern features; remux old files out of it |\n\nFor a file you will keep or edit later, use MKV. For a file you will send to someone or put on a website, use MP4 (H.264 or HEVC plus AAC or Opus) or WebM. [ISOBMFF](/containers/isobmff/) is the shared base format behind MP4, MOV, HEIF and AVIF.\n\n## Remuxing\n\nCopy streams from one container to another without re-encoding:\n\n```sh\nffmpeg -i input.mkv -c copy output.mp4\nmkvmerge -o output.mkv input.mp4\n```\n\nThis only works if the target container can hold the streams. Without `-map`, FFmpeg keeps one video, one audio and at most one subtitle stream, and it can drop the subtitles without complaint when they cannot be copied, so check the result with `ffprobe`. Subtitles are the usual casualty; see [Audio and subtitle handling](/guides/audio-and-subtitles/) and the [subtitle formats](/codecs/subtitles/) overview.\n\n## What containers do not do\n\n- They do not fix a bad encode or add compatibility to a codec: an MP4 holding a codec your TV cannot decode will not play.\n- They do not decide the codec. A `.mp4` can hold H.264, HEVC, AV1 or VP9; check with `ffprobe` rather than trusting the extension.\n- Colour and HDR signalling live partly in the bitstream and partly in the container. Remuxing between families can drop or rewrite the container-level part, so verify HDR files after remuxing. See [Preserve colour and HDR](/guides/preserve-color-and-hdr/).\n"
}
