Ogg


Ogg is a free, open container format maintained by the Xiph.Org Foundation. The creators of the Ogg format state that it is unrestricted by software patents and is designed to provide for efficient streaming and manipulation of high-quality digital multimedia. Its name is derived from "ogging", jargon from the computer game Netrek.
The Ogg container format can multiplex a number of independent streams for audio, video, text, and metadata.
In the Ogg multimedia framework, Theora provides a lossy video layer. The audio layer is most commonly provided by the music-oriented Vorbis format or its successor Opus. Lossless audio compression formats include FLAC, and OggPCM.
Before 2007, the.ogg filename extension was used for all files whose content used the Ogg container format. Since 2007, the Xiph.Org Foundation recommends that.ogg only be used for Ogg Vorbis audio files. The Xiph.Org Foundation decided to create a new set of file extensions and media types to describe different types of content such as.oga for audio only files,.ogv for video with or without sound, and.ogx for multiplexed Ogg.
As of November 7, 2017, the current version of the Xiph.Org Foundation's reference implementation is libogg 1.3.3. Another version, libogg2, has been in development, but is awaiting a rewrite as of 2018. Both software libraries are free software, released under the New BSD License. Ogg reference implementation was separated from Vorbis on September 2, 2000.
Because the format is free, and its reference implementation is not subject to restrictions associated with copyright, Ogg's various codecs have been incorporated into a number of different free and proprietary media players, both commercial and non-commercial, as well as portable media players and GPS receivers from different manufacturers.

Naming

Ogg is derived from "ogging", jargon from the computer game Netrek, which came to mean doing something forcefully, possibly without consideration of the drain on future resources. At its inception, the Ogg project was thought to be somewhat ambitious given the limited power of the PC hardware of the time. Although it is sometimes assumed that the name "Ogg" comes from the character of Nanny Ogg in Terry Pratchett's Discworld novels, the format's developers say that is not true. Still, to quote the same reference: "Vorbis, on the other hand is named after the Terry Pratchett character from the book Small Gods".
The Ogg Vorbis project started in 1993. It was originally named "Squish" but that name was already trademarked, so the project underwent a name change. The new name, "OggSquish", was used until 2001 when it was changed again to "Ogg". Ogg has since come to refer to the container format, which is now part of the larger Xiph.org multimedia project. Today, "Squish" refers to a particular audio coding format typically used with the Ogg container format.

File format

The "Ogg" bitstream format, spearheaded by the Xiph.Org Foundation, has been created as the framework of a larger initiative aimed at developing a set of components for the coding and decoding of multimedia content, which are available free of charge and freely re-implementable in software.
The format consists of chunks of data each called an "Ogg page". Each page begins with the characters, "OggS", to identify the file as Ogg format.
A "serial number" and "page number" in the page header identifies each page as part of a series of pages making up a bitstream. Multiple bitstreams may be multiplexed in the file where pages from each bitstream are ordered by the seek time of the contained data. Bitstreams may also be appended to existing files, a process known as "chaining", to cause the bitstreams to be decoded in sequence.
A BSD-licensed library, called "libvorbis", is available to encode and decode data from "Vorbis" streams. Independent Ogg implementations are used in several projects such as RealPlayer and a set of DirectShow filters.
Mogg, the "Multi-Track-Single-Logical-Stream Ogg-Vorbis", is the multi-channel or multi-track Ogg file format.

Page structure

The following is the field layout of an Ogg page header:
;Capture pattern – 32 bits
;Version – 8 bits
;Header type – 8 bits
;Granule position – 64 bits
;Bitstream serial number – 32 bits
;Page sequence number – 32 bits
;Checksum – 32 bits
;Page segments – 8 bits
;Segment table
The segments provide a way to group segments into packets, which are meaningful units of data for the decoder. When the segment's length is indicated to be 255, this indicates that the following segment is to be concatenated to this one and is part of the same packet. When the segment's length is 0–254, this indicates that this segment is the final segment in this packet. Where a packet's length is a multiple of 255, the final segment is length 0.
Where the final packet continues on the next page, the final segment value is 255, and the continuation flag is set on the following page to indicate that the start of the new page is a continuation of last page.

Metadata

is a base-level Metadata format initially created for use with Ogg Vorbis. It has since been adopted in the specifications of Ogg encapsulations for other Xiph.Org codecs including Theora, Speex, FLAC and Opus. VorbisComment is the simplest and most widely-supported mechanism for storing metadata with Xiph.Org codecs.
Notably, one or more METADATA_BLOCK_PICTURE=… in a VorbisComment for thumbnails and cover art have Base64-encoded values of the corresponding FLAC METADATA_BLOCK_PICTURE. In other words, FLAC stores thumbnails and cover art in binary blocks—outside of the FLAC tags in a little-endian METADATA_BLOCK_VORBIS_COMMENT.
Other existing and proposed mechanisms are:
The Ogg project began with a simple audio compression package as part of a larger project in 1993. The software was originally named Squish but due to an existing trade mark it was renamed to OggSquish. This name was later used for the whole Ogg project. In 1997, the Xiphophorus OggSquish was described 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". The OggSquish was in 2000 referred to as "a group of several related multimedia and signal processing projects". In 2000, two projects were in active development for planned release: Ogg Vorbis format and libvorbis - the reference implementation of Vorbis. Research also included work on future video and lossless audio coding. In 2001, OggSquish was renamed to Ogg and it was described as "the umbrella for a group of several related multimedia and signal processing projects". Ogg has come to stand for the file format, as part of the larger Xiph.org multimedia project. Squish became just the name of one of the Ogg codecs. In 2009, Ogg is described as "a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs".
Ogg reference implementation was separated from Vorbis on September 2, 2000.
In May 2003, two Internet RFCs were published relating to the format. The Ogg bitstream was defined in RFC 3533 and its Internet content type in RFC 3534. In September 2008, RFC 3534 was obsoleted by RFC 5334, which added content types video/ogg, audio/ogg and filename extensions.ogx,.ogv,.oga,.spx.

OGM

In 2002, the lack of formal video support in Ogg resulted in the creation of the OGM file format, a hack on Ogg that allowed embedding of video from the Microsoft DirectShow framework into an Ogg-based wrapper. OGM was initially supported only by closed source Windows-only tools, but the code base was subsequently opened. Later, video support were formally specified for Ogg but in a manner incompatible with OGM. Independently, the Matroska container format reached maturity and provided an alternative for people interested in combining Vorbis audio and arbitrary video codecs. As a result, OGM is no longer supported or developed and is formally discouraged by Xiph.org. Today, video in Ogg is found with the.ogv file extension, which is formally specified and officially supported. Software and codecs that support.ogm files are available without charge.

2006

Although Ogg had not reached anywhere near the ubiquity of the MPEG standards,, it was commonly used to encode free content and had started to be supported by a significant minority of digital audio players. Also supporting the Ogg format were many popular video game engines, including Doom 3, Unreal Tournament 2004,, Jets n Guns,,, Stepmania,, Lineage 2, Vendetta Online, Battlefield 2, and the Grand Theft Auto engines, as well as the audio files of the Java-based game, Minecraft. The more popular Vorbis codec had built-in support on many software players, and extensions were available for nearly all the rest.

2007

On May 16, 2007, the Free Software Foundation started a campaign to increase the use of Vorbis "as an ethically, legally and technically superior audio alternative to the proprietary MP3 format." People were also encouraged to support the campaign by adding a web button to their website or blog. For those who don't want to download and use FSF's suggested Ogg player, the Xiph.Org Foundation had an official codec for QuickTime-based applications in Windows and Mac OS X, such as iTunes players and iMovie applications; and Windows users could install a Windows Media Player Ogg codec.

2009

By June 30, 2009, the Ogg container, through the use of the Theora and Vorbis, was the only container format included in Firefox 3.5 web browser's implementation of the HTML 5 <video> and <audio> elements. This was in accordance with the original recommendation outlined in, but later removed from, the HTML 5 draft specification.

2010

On March 3, 2010, a technical analysis by an FFmpeg developer was critical about the general purpose abilities of Ogg as a multimedia container format. The creator of Ogg later responded to these claims in an article of his own.

Ogg codecs

Ogg is only a container format. The actual audio or video encoded by a codec is stored inside an Ogg container. Ogg containers may contain streams encoded with multiple codecs, for example, a video file with sound contains data encoded by both an audio codec and a video codec.
Being a container format, Ogg can embed audio and video in various formats but Ogg was intended to be, and usually is, used with the following Xiph.org free codecs:
Ogg audio media is registered as IANA media type audio/ogg with file extensions .oga, .ogg, and .spx. It is a proper subset of the Ogg video media type video/ogg with file extension .ogv. Other Ogg applications use media type application/ogg with file extension .ogx, this is a superset of video/ogg. The Opus media type audio/opus with file extension .opus was registered later in RFC and .