{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/containers/ogg",
  "collection": "docs",
  "title": "Ogg",
  "description": "Ogg is the Xiph.Org container used for Opus, Vorbis and FLAC audio and Theora video; this page covers the extensions, remuxing and the quirks of Ogg Opus.",
  "canonicalUrl": "https://encode.wiki/containers/ogg/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/containers/ogg.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/containers/ogg.md",
  "status": "current",
  "tags": [
    "containers",
    "ogg"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "RFC 3533 — The Ogg Encapsulation Format Version 0",
      "url": "https://datatracker.ietf.org/doc/html/rfc3533",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "RFC 7845 — Ogg Encapsulation for the Opus Audio Codec",
      "url": "https://datatracker.ietf.org/doc/html/rfc7845",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "FFmpeg formats documentation — ogg muxer",
      "url": "https://ffmpeg.org/ffmpeg-formats.html#ogg-1",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "WebKit features in Safari 18.4",
      "url": "https://webkit.org/blog/16574/webkit-features-in-safari-18-4/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "headings": [
    {
      "depth": 2,
      "text": "Extensions",
      "anchor": "extensions"
    },
    {
      "depth": 2,
      "text": "Make Ogg files",
      "anchor": "make-ogg-files"
    },
    {
      "depth": 2,
      "text": "Properties of Ogg",
      "anchor": "properties-of-ogg"
    },
    {
      "depth": 2,
      "text": "Support",
      "anchor": "support"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/containers/ogg/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/_preamble.md",
      "checksum": "bde1429a4fddf29e990f39612fd471cc94e87b176fd278d2c756e67513e8eb3a",
      "bytes": 345
    },
    {
      "id": "extensions",
      "title": "Extensions",
      "depth": 2,
      "anchor": "extensions",
      "canonicalUrl": "https://encode.wiki/containers/ogg/#extensions",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/extensions.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/extensions.md",
      "checksum": "e346539fb10df3cffa31ef63392526e837704a8f6c2f5b0a58bc6bd756fdff2a",
      "bytes": 1124
    },
    {
      "id": "make-ogg-files",
      "title": "Make Ogg files",
      "depth": 2,
      "anchor": "make-ogg-files",
      "canonicalUrl": "https://encode.wiki/containers/ogg/#make-ogg-files",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/make-ogg-files.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/make-ogg-files.md",
      "checksum": "64f1ed5ed93d35953e36d7278d27475a818991aff740447588158e5b95d58e16",
      "bytes": 631
    },
    {
      "id": "properties-of-ogg",
      "title": "Properties of Ogg",
      "depth": 2,
      "anchor": "properties-of-ogg",
      "canonicalUrl": "https://encode.wiki/containers/ogg/#properties-of-ogg",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/properties-of-ogg.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/properties-of-ogg.md",
      "checksum": "ec158f9e0fb45302b91e961e1c6c0901838734dd308e1f803bdbd8a42998cd81",
      "bytes": 892
    },
    {
      "id": "support",
      "title": "Support",
      "depth": 2,
      "anchor": "support",
      "canonicalUrl": "https://encode.wiki/containers/ogg/#support",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/support.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/containers/ogg/support.md",
      "checksum": "93db70e46a3df05f55d943fd51ed965c0f33540f7ec9fd982df4e07581b4bbc1",
      "bytes": 395
    }
  ],
  "outboundReferences": [
    "/api/v1/catalog.json",
    "/codecs/audio/flac/",
    "/codecs/audio/opus/",
    "/codecs/audio/vorbis/",
    "/codecs/video/theora/",
    "https://datatracker.ietf.org/doc/rfc7845/"
  ],
  "checksum": "0b477115f3fd131ec73ceecbeab82d4bf4bab7507f1afebf28d33490bd92886e",
  "contentFormat": "markdown",
  "markdown": "Ogg is Xiph.Org's open container. Today it is mostly used for audio: [Opus](/codecs/audio/opus/) in a `.opus` file is the most common case, followed by [Vorbis](/codecs/audio/vorbis/), [FLAC](/codecs/audio/flac/) and Speex. It can also hold [Theora](/codecs/video/theora/) video, but nobody should start a new video project on that combination.\n\n## Extensions\n\n| Extension | Contents                                                       |\n| --------- | -------------------------------------------------------------- |\n| `.opus`   | Opus audio in Ogg (the recommended extension for Opus)         |\n| `.ogg`    | Historically Vorbis; now ambiguous, can be Opus, FLAC or video |\n| `.oga`    | Ogg audio, any codec                                           |\n| `.ogv`    | Ogg video, normally Theora + Vorbis                            |\n| `.spx`    | Speex                                                          |\n\nThe extension does not say which codec is inside; `ffprobe` does.\n\n**Codecs documented for Ogg on this wiki**\n\n| Relationship | Project or format | Evidence and scope | Status |\n| --- | --- | --- | --- |\n| Carried By by | [Opus](/codecs/audio/opus/) | Ogg Opus uses OpusHead and OpusTags headers with 48 kHz granule-position semantics. Scope: Container Mapping. Sources: [RFC 7845: Ogg Encapsulation for the Opus Audio Codec](https://datatracker.ietf.org/doc/rfc7845/). | Normative |\n\n[Open the complete typed relationship catalog](/api/v1/catalog.json).\n\n## Make Ogg files\n\n```sh\nffmpeg -i input.flac -c:a libopus -b:a 128k output.opus\nffmpeg -i input.flac -c:a libvorbis -q:a 5 output.ogg\nffmpeg -i input.mkv -c:v libtheora -q:v 7 -c:a libvorbis -q:a 5 output.ogv\n```\n\nOpus is the better modern choice; see [Opus](/codecs/audio/opus/) for bitrates. Moving an existing Opus stream between Ogg and MP4/MKV is lossless: `ffmpeg -i input.mp4 -c copy output.opus`. Ogg cannot hold AAC, MP3 or H.264 (FFmpeg rejects them), so converting from those means re-encoding.\n\nFor standalone Opus encoding, `opusenc` from opus-tools writes Ogg Opus directly and can embed cover art with `--picture`.\n\n## Properties of Ogg\n\n- **Streaming-first design.** Ogg is made of self-contained pages with no global index, so it can be written live and chained (several files concatenated into one stream). Seeking works by bisection, which is fast for audio and sloppy for video.\n- **Metadata** is stored as Vorbis-style comments (`ARTIST=`, `TITLE=`…). Opus adds `R128_TRACK_GAIN` and `R128_ALBUM_GAIN` for loudness; players apply the header's output gain and these tags. Edit tags with `opustags`, `vorbiscomment` or `ffmpeg -metadata`.\n- **Opus timing.** An Ogg Opus stream always decodes at 48 kHz, whatever the input rate, and carries a pre-skip value the decoder discards so the first sample lines up. That is why `ffprobe` shows `sample_rate=48000` for any `.opus`.\n- **Overhead.** Ogg's page structure costs a bit more than MKV or MP4 for the same stream, which is small next to Opus bitrates.\n\n## Support\n\nOgg Opus and Vorbis play in Chrome, Firefox, VLC, mpv, Android and most Linux and Windows players. Safari added Ogg support for Opus and Vorbis in 18.4 (March 2025, on macOS 15.4, iOS/iPadOS 18.4 and visionOS 2.4); older Apple software cannot play `.opus` files without help. For maximum compatibility, deliver MP4 with AAC, or an Opus-in-MP4/WebM file where the player supports it.\n"
}
