Ogg is an open standard for a free container format
for digital multimedia, unrestricted by software patents and designed for efficient
streaming and manipulation. Ogg is maintained by the Xiph.Org Foundation.
name ¡®Ogg¡¯ refers to the file format which can multiplex
a number of separate independent free and open source codecs for audio, video,
text (such as subtitles), and metadata. The term ¡®Ogg¡¯
is often used to refer to audio file format Ogg Vorbis, that is, Vorbis-encoded
audio in the Ogg container. Other prominent Xiph codecs that are often encapsulated
in Ogg are the video codec Theora, and the human speech audio compression format
Previously, the .ogg file extension was used for any content distributed
within Ogg, but as of 2007, the Xiph.Org Foundation requests that .ogg be used
only for Vorbis due to backwards-compatibility concerns. 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, .ogv for video (including Theora), and
.ogx for applications.
The current version of the Xiph.Org Foundation's
reference implementation, released on 27 November 2005, is libogg 1.1.3.Another
version, libogg2, is also available from the Xiph.Org Foundation's SVN repositories.
Both software libraries are free software, released under the new BSD license.
the format is free, 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
is often erroneously assumed that the name Ogg comes from the character of Nanny
Ogg in Terry Pratchett's Discworld novels. Rather, it derives 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 power of the PC hardware
of the time.
 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 are freely re-implementable in
The format consists of chunks of data each called an Ogg Page.
Each page begins with the "OggS" string to identify the file as Ogg
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.
BSD-licensed library, called libogg, is available to encode and decode data from
Ogg streams. Independent Ogg implementations are used in several projects such
as RealPlayer and a set of DirectShow filters.
following is the field layout of an Ogg page header:
0 1 2 3
0 1 2
3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte
capture_pattern: Magic number for page start "OggS" | 0-3
version | header_type | granule_position | 4-7
| bitstream_serial_number | 12-15
| page_sequence_number | 16-19
| CRC_checksum | 20-23
| page_segments | segment_table | 24-27
... | 28-