Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Ogg
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==File format== The "Ogg" [[bitstream format]], designed principally by the Xiph.Org Foundation, has been developed as the framework of a larger initiative aimed at producing a set of components for the coding and decoding of multimedia files, which are available free of charge and freely re-implementable in software and hardware. 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 [[multiplexing|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 licenses|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.<ref>{{cite web| url = http://xiph.org/dshow/| title = Directshow Filters for Ogg Vorbis| access-date = 2015-02-14| archive-date = 2015-02-08| archive-url = https://web.archive.org/web/20150208215333/http://www.xiph.org/dshow/| url-status = live}}</ref> 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: [[File:Ogg page header structure (en).svg|512px|center|The field layout of an Ogg page header]] ;Capture pattern β 32 bits :The capture pattern or sync code is a [[magic number (programming)|magic number]] used to ensure synchronization when parsing Ogg files. Every page starts with the four ASCII character sequence, "OggS". This assists in resynchronizing a parser in cases where data has been lost or is corrupted, and is a sanity check before commencing parsing of the page structure. ;Version β 8 bits :This field indicates the version of the Ogg bitstream format, to allow for future expansion. It is currently mandated to be 0. ;Header type β 8 bits :This is an 8 bit field of flags, which indicates the type of page that follows. :{| class="wikitable" ! style="width:5%;"|Bit ! style="width:10%;"|Value ! style="width:10%;"|Flag ! style="width:75%;"|Page type |- |0 |0x01 |Continuation |The first packet on this page is a continuation of the previous packet in the logical bitstream. |- |1 |0x02 |BOS |Beginning Of Stream. This page is the first page in the logical bitstream. The BOS flag must be set on the first page of every logical bitstream, and must not be set on any other page. |- |2 |0x04 |EOS |End Of Stream. This page is the last page in the logical bitstream. The EOS flag must be set on the final page of every logical bitstream, and must not be set on any other page. |} ;Granule position β 64 bits :A granule position is the time marker in Ogg files. It is an abstract value, whose meaning is determined by the codec. It may, for example, be a count of the number of samples, the number of frames or a more complex scheme. ;Bitstream serial number β 32 bits :This field is a serial number that identifies a page as belonging to a particular logical bitstream. Each logical bitstream in a file has a unique value, and this field allows implementations to deliver the pages to the appropriate decoder. In a typical Vorbis and Theora file, one stream is the audio (Vorbis), and the other is the video (Theora) ;Page sequence number β 32 bits :This field is a monotonically increasing field for each logical bitstream. The first page is 0, the second 1, etc. This allows implementations to detect when data has been lost. ;[[Checksum]] β 32 bits :This field provides a [[CRC32]] checksum of the data in the entire page (including the page header, calculated with the checksum field set to 0). This allows verification that the data has not been corrupted since it was authored. Pages that fail the checksum should be discarded. The checksum is generated using a polynomial value of 0x04C11DB7. ;Page segments β 8 bits :This field indicates the number of segments that exist in this page. It also indicates how many bytes are in the segment table that follows this field. There can be a maximum of 255 segments in any one page. ;Segment table :The segment table is an array of 8-bit values, each indicating the length of the corresponding segment within the page body. The number of segments is determined from the preceding page segments field. Each segment is between 0 and 255 bytes in length. 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=== {{Main article|Vorbis comment}} [[Vorbis comment|VorbisComment]] is a base-level Metadata format initially authored 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 (audio format)|Opus]]. ''VorbisComment'' is the simplest and most widely supported mechanism for storing metadata with Xiph.Org codecs.<ref>{{Cite web|url=https://wiki.xiph.org/VorbisComment|title=VorbisComment|date=26 April 2016|access-date=23 October 2018|archive-date=23 October 2018|archive-url=https://web.archive.org/web/20181023234243/https://wiki.xiph.org/VorbisComment|url-status=live}}</ref> Notably,{{attribution needed|date=October 2021}}<!--Wikipedia cannot say in its own voice that this is notable; if it has been considered notable by a source or sources, then that can be reported--> one or more <kbd>METADATA_BLOCK_PICTURE=</kbd>... in a ''VorbisComment'' for thumbnails and cover art have [[Base64]]-encoded values of the corresponding [[FLAC#Metadata|FLAC]] <kbd>METADATA_BLOCK_PICTURE</kbd>. In other words, FLAC stores thumbnails and cover art in binary blocks—outside of the FLAC tags in a [[little-endian]] <kbd>METADATA_BLOCK_VORBIS_COMMENT</kbd>.<ref>{{cite web |url=https://xiph.org/flac/format.html#metadata_block_picture |title=METADATA_BLOCK_PICTURE |work=flac free lossless audio codec |publisher=[[Xiph.Org Foundation|Xiph.Org]] |year=2014 |access-date=2019-12-03 |archive-date=2017-03-27 |archive-url=https://web.archive.org/web/20170327065952/https://xiph.org/flac/format.html#metadata_block_picture |url-status=live }}</ref><ref>{{cite web |url=https://www.xiph.org/vorbis/doc/v-comment.html |title=Ogg Vorbis I format specification: comment field and header specification |publisher=[[Xiph.Org Foundation|Xiph.Org]] |year=2005 |access-date=2019-12-03 |archive-date=2019-12-03 |archive-url=https://web.archive.org/web/20191203005103/https://www.xiph.org/vorbis/doc/v-comment.html |url-status=live }}</ref> Other existing and proposed mechanisms are:<ref>{{Cite web|url=https://wiki.xiph.org/Metadata|title=Metadata|date=24 July 2013|website=xiph.org Foundation|access-date=23 October 2018|archive-date=23 October 2018|archive-url=https://web.archive.org/web/20181023234247/https://wiki.xiph.org/Metadata|url-status=live}}</ref> * [[FLAC]] metadata blocks * Ogg Skeleton<ref>{{cite web |url=https://wiki.xiph.org/Ogg_Skeleton_4 |title=Ogg Skeleton 4 |publisher=[[Xiph.Org Foundation|Xiph.Org]] |year=2012 |access-date=2019-12-03 |archive-date=2019-08-13 |archive-url=https://web.archive.org/web/20190813223619/https://wiki.xiph.org/Ogg_Skeleton_4 |url-status=live }}</ref> * [[Continuous Media Markup Language]] (deprecated)
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Ogg
(section)
Add topic