Ogg
Ogg is a digital multimedia container format maintained by the Xiph.Org Foundation, and its name carries a stranger origin story than most software projects. It comes from "ogging," a piece of jargon from the computer game Netrek. In that game, to "ogg" something meant doing it forcefully, possibly without thought for the drain on future resources. The project's early authors saw that description as an honest reflection of their own ambitions. Given the limited power of personal computers at the time, what they were attempting felt aggressive, even reckless. What were they trying to build? A free, open, patent-unencumbered framework for storing and streaming audio and video. And why did that matter? Because the dominant formats of the era were locked down by software patents, and the people behind Ogg believed media should not work that way. The questions that follow from that starting point are the ones this documentary will answer: how the format was designed, what lives inside its pages, how it grew, and where it still lives today.
The project began in 1993 under the name Squish, as part of a larger audio compression effort. That name turned out to be already trademarked, so the team renamed it OggSquish. By 1997, the Xiphophorus organization described OggSquish as "an attempt both to create a flexible compressed audio format for modern audio applications as well as to provide the first audio format that is common on any and every modern computer platform." Three years later, in 2000, two projects were in active development for planned release: the Ogg Vorbis format and libvorbis, the reference implementation of Vorbis. Research at that time also covered future video and lossless audio coding. In 2001, OggSquish was renamed simply to Ogg. Squish, the original name, became the designation for just one of Ogg's audio codecs, now known as Vorbis. The name Vorbis itself carries a literary reference. While Ogg is unrelated to the character Nanny Ogg in Terry Pratchett's Discworld novels, Vorbis is named after a different Pratchett character, from the book Small Gods. The reference implementation for Ogg was separated from Vorbis on the 2nd of September, 2000, marking the point at which the container and its most prominent audio codec became formally distinct projects.
Every Ogg file is composed of chunks called Ogg pages, and each page begins with the four-character sequence "OggS." Those four ASCII characters serve as a capture pattern, or sync code, a fixed marker that helps a parser find its footing when data has been lost or corrupted. Beyond that opening signature, each page carries a header with several fields. A version field, currently mandated to be 0, allows for future expansion of the format. A header type field uses bit flags to signal whether a page is a continuation of a previous packet, the beginning of a stream, or the end of one. The granule position field stores a time marker as a 64-bit value; its exact meaning depends on the codec, and may represent a sample count, a frame count, or a more complex scheme. A 32-bit bitstream serial number ties each page to its logical stream within a file, allowing separate decoders to receive the correct data. A monotonically increasing page sequence number, starting at 0, lets implementations detect gaps from lost data. The page also contains a CRC-32 checksum, calculated using a polynomial value of 0x04C11DB7, covering the entire page with the checksum field itself temporarily set to 0. Pages failing that check are discarded. Finally, a segment table at the end of the header lists the length of each segment in the page body, up to a maximum of 255 segments per page, with each segment running between 0 and 255 bytes.
Ogg is only a container. The audio, video, or text it carries depends entirely on the codecs placed inside it, and the Xiph.Org Foundation developed several for exactly this purpose. On the audio side, Speex handles voice at low bitrates, approximately 2.1-32 kilobits per second per channel. Vorbis covers general audio at mid to high variable bitrates, roughly 16-500 kilobits per second per channel. Opus, the successor to Vorbis, handles voice, music, and general audio across a wider range, from approximately 6-510 kilobits per second per channel. For lossless audio, FLAC handles archival and high-fidelity work, while OggPCM allows standard uncompressed PCM audio to be stored inside an Ogg container. On the video side, Theora, based on On2's VP3, was built to compete with MPEG-4 video formats such as those encoded with DivX or Xvid, as well as RealVideo and Windows Media Video. A more experimental codec called Tarkin was developed in 2000, 2001, and 2002 using discrete wavelet transforms across the three dimensions of width, height, and time; it was placed on hold in August 2002 after Theora became the main focus for video encoding. Dirac, a free and open video format developed by the BBC, uses wavelet encoding and covers both lossy and lossless compression within its specification. A format called Mogg, described as the Multi-Track-Single-Logical-Stream Ogg-Vorbis, handles multi-channel or multi-track files.
In 2002, Ogg had no formal support for video, and that gap led to an improvised workaround. A developer created the OGM file format, essentially a hack on top of Ogg that allowed video from Microsoft's DirectShow framework to be embedded in an Ogg-based wrapper. OGM launched with support only from closed-source, Windows-only tools, though its codebase was later opened. The situation resolved in a way that made OGM obsolete from two directions at once. Xiph.Org eventually produced a formal video specification for Ogg, but the new specification was incompatible with OGM. At the same time, the Matroska container format matured independently and offered anyone wanting to combine Vorbis audio with arbitrary video codecs a well-supported alternative. Xiph.Org now formally discourages OGM. Video in Ogg today is identified by the .ogv file extension, a formally specified and officially supported designation. Software that still handles .ogm files remains available, though without active development behind it.
In May 2003, two Internet RFCs were published covering Ogg. The bitstream format was documented in one, classified as informative, while the Internet content type application/ogg appeared in another, issued as a proposed standard. In September 2008, that earlier RFC was superseded by a newer one that added content types video/ogg and audio/ogg and introduced the file extensions .ogx, .ogv, .oga, and .spx. Broader adoption came from an unexpected direction: video game engines. By 2006, Ogg was supported by a significant number of game engines, among them Doom 3, Unreal Tournament 2004, Halo: Combat Evolved, Minecraft, and several Grand Theft Auto engines. On the 16th of May, 2007, the Free Software Foundation launched a campaign to promote Vorbis as an ethically, legally, and technically superior alternative to the proprietary MP3 format. By the 30th of June, 2009, Ogg was the only container format included in Firefox 3.5's implementation of the HTML5 video and audio elements, in line with an early HTML5 draft recommendation that was later removed from the specification. On the 3rd of March, 2010, an FFmpeg developer published a technical critique of Ogg's general-purpose capabilities as a multimedia container. The author of Ogg responded with a published article of his own. The file extension history itself reflects ongoing refinement: before 2007, the .ogg extension was used for all files using the container format, but since then Xiph.Org recommends reserving .ogg specifically for Ogg Vorbis audio files, with .oga for audio-only, .ogv for video, and .ogx for multiplexed content.
VorbisComment is the metadata format that sits inside Ogg files. It was originally authored for Ogg Vorbis but has since been adopted by the specifications for Theora, Speex, FLAC, and Opus. It is described as the simplest and most widely supported mechanism for storing metadata with Xiph.Org codecs. Cover art and thumbnails are handled through a specific convention: one or more METADATA_BLOCK_PICTURE entries carry Base64-encoded values of the corresponding FLAC METADATA_BLOCK_PICTURE structure. This allows thumbnail data to travel inside a VorbisComment, even though FLAC stores that same data as binary blocks in a little-endian format outside of the VorbisComment structure itself. Bitstreams can also be appended to existing Ogg files through a process called chaining, which causes the appended bitstreams to decode in sequence. As of the 7th of November, 2017, the current version of the reference implementation, libogg, was at version 1.3.3. A second version, libogg2, was in development but awaiting a rewrite as of 2018. Both are free software released under the New BSD License. Independent Ogg implementations appear in several projects beyond Xiph.Org's own tools, including RealPlayer and a set of DirectShow filters, and Ogg's various codecs have been incorporated into portable media players and GPS receivers from multiple manufacturers.
Common questions
What does the name Ogg come from?
Ogg is derived from "ogging," a term from the computer game Netrek meaning doing something forcefully, possibly without regard for future resource costs. The project's authors felt the name reflected their ambition given the limited hardware of the time.
Who maintains the Ogg container format?
Ogg is maintained by the Xiph.Org Foundation. The reference implementation, libogg, is released under the New BSD License and was at version 1.3.3 as of the 7th of November, 2017.
What audio codecs are used inside Ogg files?
The most common audio codecs for Ogg are Vorbis, which handles general audio at roughly 16-500 kilobits per second per channel, and its successor Opus, which covers voice and music at approximately 6-510 kilobits per second per channel. Lossless options include FLAC and OggPCM.
What file extensions does the Ogg format use?
Since 2007, Xiph.Org recommends .ogg only for Ogg Vorbis audio files. The extension .oga is used for audio-only files, .ogv for video with or without sound, and .ogx for multiplexed Ogg content.
What is the OGM format and is it still used?
OGM was a 2002 workaround that embedded Microsoft DirectShow video inside an Ogg-based wrapper. It is no longer developed or supported and is formally discouraged by Xiph.Org, which later introduced the official .ogv extension for Ogg video.
What is Vorbis named after?
Vorbis is named after a character in Terry Pratchett's novel Small Gods. The connection to Pratchett is indirect: the Ogg name itself is unrelated to Nanny Ogg from the Discworld novels, but the Vorbis codec was deliberately named after a Pratchett character.
All sources
38 references cited across the entry
- 1tech reportOgg File FormatLibrary of Congress — 19 February 2008
- 2webSample Xiph.Org Variant of the BSD LicenseXiph.Org Foundation
- 3webVorbis.com: FAQ
- 4webOgging 101
- 5webMIME Types and File Extensions2007-09-07
- 6mailing listlibogg 1.3.3 releaseRalph Giles — 2017-11-07
- 7mailing listr14372 - in trunk/theora: . lib/dec lib/encRalph Giles — 2008-01-05
- 9webXiph.org: namingXiph.org Foundation — 2006-01-07
- 11webVorbisComment26 April 2016
- 12webMETADATA_BLOCK_PICTUREXiph.Org — 2014
- 13webOgg Vorbis I format specification: comment field and header specificationXiph.Org — 2005
- 14webMetadata24 July 2013
- 15webOgg Skeleton 4Xiph.Org — 2012
- 16webOgg 98.9Christopher Montgomery — Xiphophorus company — 1997
- 17webOggSquish Vorbis encoding format documentationXiph.org — 2000-01-18
- 18webOggSquish logical and physical bitstream overviewXiph.org — 2000-01-18
- 19webThe Ogg project homepageXiphophorus company — 2001-04-05
- 22webThe Ogg container formatXiph.Org Foundation — 2006-01-07
- 23webOGM is not Ogg. Xiph.org does not support OGM.Backup at WayBack Machine — 2004-07-07
- 25magazineMP3's Loss, Open Source's GainEvan Hansen — 2007-02-23
- 26web'Play Ogg': FSF launches free audio format campaignMatt Lee — Free Software Foundation — May 16, 2007
- 28webDirectshow Filters for Ogg Vorbis, Speex, Theora and FLACXiph.org — 2010-02-22
- 29webMozilla Developer Center - HTML - Element - VideoSeptember 2009
- 30webMozilla Developer Center - HTML - Element - AudioSeptember 2009
- 31webOgg objectionsMans Rullgard — hardwarebug.org — 2010-03-03
- 32webMonty - In Defense of Ogg's Good NameChristopher Montgomery — people.xiph.org/~xiphmont — 2010-04-27
- 34webOggPCMXiphWiki — 2020-05-25
- 39inlineRetrieved on 2009-07-05
- 40webOggKate2017
- 41ietfOgg Media TypesI. Goncalves et al. — 2008