Ogg: Difference between revisions
(→External links: **) |
|||
(13 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
The '''Ogg''' transport bitstream is designed to provide framing, error protection and seeking structure for higher-level codec streams that consist of raw, unencapsulated data packets, such as the [[Opus]], [[Vorbis]] and [[FLAC]] audio codecs or [[Theora]] and [[Dirac]] video codecs. | The '''Ogg''' transport bitstream is designed to provide framing, error protection and seeking structure for higher-level codec streams that consist of raw, unencapsulated data packets, such as the [[Opus]], [[Vorbis]] and [[FLAC]] audio codecs or the [[Theora]] and [[Dirac]] video codecs. | ||
== Name == | == Name == | ||
Ogg derives from "ogging", jargon from the computer game Netrek. Ogg is not an acronym and should not be mentioned as "OGG" | Ogg derives from "ogging", jargon from the [https://wikipedia.org/wiki/Netrek computer game Netrek]. Ogg is not an acronym and should not be mentioned as "OGG". | ||
== Design constraints for Ogg bitstreams == | == Design constraints for Ogg bitstreams == | ||
Line 16: | Line 12: | ||
* Simple mechanism to ease limited editing, such as a simplified concatenation mechanism. | * Simple mechanism to ease limited editing, such as a simplified concatenation mechanism. | ||
* Detection of corruption, recapture after error and direct, random access to data at arbitrary positions in the bitstream. | * Detection of corruption, recapture after error and direct, random access to data at arbitrary positions in the bitstream. | ||
== Specification / standard== | |||
The Ogg transport bitstream and file format is defined in RFC 3533 approved 2003-May. As RFC documents are invariable once approved, there will never be newer versions of RFC 3533, but an [[RFC_3533_Errata]] exists instead. | |||
Existing flaws are discussed at [[OggIssues]], ideas for the future at [[TransOgg]]. | |||
== Detecting Ogg files and extracting information == | |||
Ogg files begin with a signature "OggS". This signature also repeats many times inside the file, at the beginning of every page. | |||
There are several tools to get information about Ogg files: | |||
* Ogginfo - part of Vorbis-Tools, supports Vorbis codec only (historical Ogg-vs-Vorbis issue), other codecs cause it to report garbage | |||
* Opusinfo - part of Opus-Tools, supports only Opus codec well, only minimal Vorbis support | |||
* Oggz ??? | |||
* [http://sourceforge.net/projects/mediainfo/ MediaInfo] - provides information about media (and some other) files, supports many types, also Ogg with various codecs, generic audio and video information only, no Ogg-specific details. | |||
== Projects using Ogg == | == Projects using Ogg == | ||
Line 21: | Line 33: | ||
=== Codecs === | === Codecs === | ||
* [[CMML]] | * [[CMML]] | ||
* [[FLAC]] ([http://flac | * [[FLAC]] ([http://xiph.org/flac/ogg_mapping.html Ogg mapping]) | ||
* [[OggKate|Kate]] | * [[OggKate|Kate]] | ||
* [http://opus-codec.org/ Opus] ([[OggOpus|Ogg mapping]]) | * [http://opus-codec.org/ Opus] ([[OggOpus|Ogg mapping]]) | ||
Line 35: | Line 46: | ||
=== Servers === | === Servers === | ||
* [[Icecast]] | * [[Icecast]] | ||
* [http://www.metavid.org/ Metavid] | * [http://www.metavid.org/ Metavid] | ||
Line 41: | Line 51: | ||
== Developer info == | == Developer info == | ||
* [[GranulePosAndSeeking]] | * [[GranulePosAndSeeking]] - a discussion of the interpretation of granulepos, and the algorithm for seeking on Ogg files | ||
* [[FishFaq]] - also discusses Granule Position | |||
=== Ogg page format === | === Ogg page format === | ||
Line 64: | Line 75: | ||
| | CRC_checksum | 20-23 | | | CRC_checksum | 20-23 | ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| |page_segments | | | page_segments | segment_table | 24-27 | ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
| ... | 28- | | ... | 28- | ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
== Implementations == | == Implementations == | ||
Line 75: | Line 85: | ||
* libogg: [http://svn.xiph.org/trunk/ogg/ libogg svn] (C, cross-platform) Low-level Ogg parsing and writing. | * libogg: [http://svn.xiph.org/trunk/ogg/ libogg svn] (C, cross-platform) Low-level Ogg parsing and writing. | ||
* liboggz: [http://git.xiph.org/?p=liboggz.git liboggz git | * liboggz: [http://git.xiph.org/?p=liboggz.git liboggz git] (C, cross-platform) liboggz wraps libogg and provides features such as seeking. | ||
* the Ogg Directshow filters: see [http://www.illiminable.com/ogg/ illiminable] (C++, Win32) | * the Ogg Directshow filters: see [http://www.illiminable.com/ogg/ illiminable] (C++, Win32) | ||
* [http://www.kfish.org/software/hogg HOgg] (pure Haskell) | * [http://www.kfish.org/software/hogg HOgg] (pure Haskell) | ||
Line 83: | Line 93: | ||
== See also == | == See also == | ||
* [[Flash]] | |||
* [[Oggless]] | * [[Oggless]] | ||
* [[MIME Types and File Extensions]] | * [[MIME Types and File Extensions]] |
Latest revision as of 06:41, 20 November 2017
The Ogg transport bitstream is designed to provide framing, error protection and seeking structure for higher-level codec streams that consist of raw, unencapsulated data packets, such as the Opus, Vorbis and FLAC audio codecs or the Theora and Dirac video codecs.
Name
Ogg derives from "ogging", jargon from the computer game Netrek. Ogg is not an acronym and should not be mentioned as "OGG".
Design constraints for Ogg bitstreams
- True streaming; we must not need to seek to build a 100% complete bitstream.
- Use no more than approximately 1-2% of bitstream bandwidth for packet boundary marking, high-level framing, sync and seeking.
- Specification of absolute position within the original sample stream.
- Simple mechanism to ease limited editing, such as a simplified concatenation mechanism.
- Detection of corruption, recapture after error and direct, random access to data at arbitrary positions in the bitstream.
Specification / standard
The Ogg transport bitstream and file format is defined in RFC 3533 approved 2003-May. As RFC documents are invariable once approved, there will never be newer versions of RFC 3533, but an RFC_3533_Errata exists instead.
Existing flaws are discussed at OggIssues, ideas for the future at TransOgg.
Detecting Ogg files and extracting information
Ogg files begin with a signature "OggS". This signature also repeats many times inside the file, at the beginning of every page.
There are several tools to get information about Ogg files:
- Ogginfo - part of Vorbis-Tools, supports Vorbis codec only (historical Ogg-vs-Vorbis issue), other codecs cause it to report garbage
- Opusinfo - part of Opus-Tools, supports only Opus codec well, only minimal Vorbis support
- Oggz ???
- MediaInfo - provides information about media (and some other) files, supports many types, also Ogg with various codecs, generic audio and video information only, no Ogg-specific details.
Projects using Ogg
Codecs
- CMML
- FLAC (Ogg mapping)
- Kate
- Opus (Ogg mapping)
- PCM
- Skeleton
- Speex (Ogg mapping)
- Theora (Ogg mapping)
- Vorbis (Ogg mapping)
- Writ
Servers
Developer info
- GranulePosAndSeeking - a discussion of the interpretation of granulepos, and the algorithm for seeking on Ogg files
- FishFaq - also discusses Granule Position
Ogg page format
The LSb (least significant bit) comes first in the Bytes. Fields with more than one byte length are encoded LSB (least significant byte) first.
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 8-11 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | bitstream_serial_number | 12-15 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | page_sequence_number | 16-19 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | CRC_checksum | 20-23 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | page_segments | segment_table | 24-27 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | 28- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Implementations
The Ogg encapsulation format can be handled with the following libraries:
- libogg: libogg svn (C, cross-platform) Low-level Ogg parsing and writing.
- liboggz: liboggz git (C, cross-platform) liboggz wraps libogg and provides features such as seeking.
- the Ogg Directshow filters: see illiminable (C++, Win32)
- HOgg (pure Haskell)
- JOrbis (pure Java) contains com.jcraft.jogg
- Mutagen (pure Python)
See also
- Flash
- Oggless
- MIME Types and File Extensions
- RFC_3533_Errata - errors and flaws in the specification
- Nut_Container