Ogg page
Encyclopedia
An Ogg page is a variable sized unit of data within an Ogg
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.The Ogg container format can multiplex...

 bitstream.

Purpose

One of the purposes of multimedia
Multimedia
Multimedia is media and content that uses a combination of different content forms. The term can be used as a noun or as an adjective describing a medium as having multiple content forms. The term is used in contrast to media which use only rudimentary computer display such as text-only, or...

 container formats is to allow multiple codec
Codec
A codec is a device or computer program capable of encoding or decoding a digital data stream or signal. The word codec is a portmanteau of "compressor-decompressor" or, more commonly, "coder-decoder"...

s to be muxed
Multiplexing
The multiplexed signal is transmitted over a communication channel, which may be a physical transmission medium. The multiplexing divides the capacity of the low-level communication channel into several higher-level logical channels, one for each message signal or data stream to be transferred...

 into a single file or stream. For example, to combine audio
Sound
Sound is a mechanical wave that is an oscillation of pressure transmitted through a solid, liquid, or gas, composed of frequencies within the range of hearing and of a level sufficiently strong to be heard, or the sensation stimulated in organs of hearing by such vibrations.-Propagation of...

, video
Video
Video is the technology of electronically capturing, recording, processing, storing, transmitting, and reconstructing a sequence of still images representing scenes in motion.- History :...

, and subtitles
Subtitle (captioning)
Subtitles are textual versions of the dialog in films and television programs, usually displayed at the bottom of the screen. They can either be a form of written translation of a dialog in a foreign language, or a written rendering of the dialog in the same language, with or without added...

 into a single file.

The viewpoint held by Christopher Montgomery, creator of the Ogg format, is that the units of muxed codec data should be a separate abstraction
Abstraction (computer science)
In computer science, abstraction is the process by which data and programs are defined with a representation similar to its pictorial meaning as rooted in the more complex realm of human life and language with their higher need of summarization and categorization , while hiding away the...

 layer from the units of data used by the codec in order to limit the amount of buffer
Buffer (computer science)
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...

ing necessary when decoding the contained data. In his opinion, which is supported by other developers working with the Xiph.org Foundation
Xiph.Org Foundation
Xiph.Org Foundation is a non-profit organizationthat produces free multimedia formats and software tools. It focuses on the Ogg family of formats, the most successful of which has been Vorbis, an open and freely licensed audio format and codec designed to compete with the patented MP3 and AAC...

, this gives Ogg a technical advantage over alternative bitstream format
Bitstream format
A bitstream format is the format of the data found in some stream of bits used in a digital communication or data storage application. The term typically refers to the format of the output of an encoder or the format of the input to a decoder when using data compression.Standardized...

s such as AVI
Audio Video Interleave
Audio Video Interleave , known by its acronym AVI, is a multimedia container format introduced by Microsoft in November 1992 as part of its Video for Windows technology. AVI files can contain both audio and video data in a file container that allows synchronous audio-with-video playback...

, QuickTime
QuickTime
QuickTime is an extensible proprietary multimedia framework developed by Apple Inc., capable of handling various formats of digital video, picture, sound, panoramic images, and interactivity. The classic version of QuickTime is available for Windows XP and later, as well as Mac OS X Leopard and...

, and MPEG.

Each Ogg page also provides the time offset of the contained data which allows efficient seeking which works with streaming
Streaming media
Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a streaming provider.The term "presented" is used in this article in a general sense that includes audio or video playback. The name refers to the delivery method of the medium rather...

 and time accurate. In contrast, many other formats seek to byte positions in the stream or rely on a table of contents
Table of contents
A table of contents, usually headed simply "Contents" and abbreviated informally as TOC, is a list of the parts of a book or document organized in the order in which the parts appear...

 for seeking information.

Page structure

Every Ogg page begins with the four-byte magic string "OggS". If sync is lost a decoder can look for the next occurrence of this sequence to begin decoding again.
This string is followed by a null byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

 for Ogg version 0. The version field had originally been intended to allow multiple Ogg page types tuned for different payloads to coexist in the same stream. At the 2000s it became clear that only one page version will be used.

The sixth byte of each page specifies type flags. The value of 1 specifies that contained data is continued from the last page. The value of 2 specifies that this is the first page of the stream, and the value of 4 specifies that this is the last page of the stream. These values can be combined with addition
Addition
Addition is a mathematical operation that represents combining collections of objects together into a larger collection. It is signified by the plus sign . For example, in the picture on the right, there are 3 + 2 apples—meaning three apples and two other apples—which is the same as five apples....

 or logical OR
Logical disjunction
In logic and mathematics, a two-place logical connective or, is a logical disjunction, also known as inclusive disjunction or alternation, that results in true whenever one or more of its operands are true. E.g. in this context, "A or B" is true if A is true, or if B is true, or if both A and B are...

.

The next 8 bytes, or 64 bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s, is called the absolute granule position which is a synthetic value that encodes the Decode Timestamp, the Presentation time stamp and distance to first-needed reference. The exact encoding of the granule position is up to a specific codec.

The following 4 bytes are the stream serial number to which this page belongs. Each logical stream must have a unique serial number within a physical stream. It is also intended to be used like a weak hash so that a collision is very unlikely when multiplexing
Multiplexing
The multiplexed signal is transmitted over a communication channel, which may be a physical transmission medium. The multiplexing divides the capacity of the low-level communication channel into several higher-level logical channels, one for each message signal or data stream to be transferred...

 different streams, which eliminates the need for continuous recalculation of page headers at every multiplexing step.

The following 4 bytes are the page sequence number within the stream. Its a Page counter that lets you know if a page is lost. The, in comparison to other container formats, large Number of 32 bits also allows direct UDP
User Datagram Protocol
The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

 unicast
Unicast
right|200pxIn computer networking, unicast transmission is the sending of messages to a single network destination identified by a unique address.-Addressing methodologies:...

/multicast
Multicast
In computer networking, multicast is the delivery of a message or information to a group of destination computers simultaneously in a single transmission from the source creating copies automatically in other network elements, such as routers, only when the topology of the network requires...

 with Ogg handling reordering and reassembly.

The next 4 bytes, starting at the 23rd byte of the page, is the CRC
Cyclic redundancy check
A cyclic redundancy check is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data...

 checksum
Checksum
A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. The integrity of the data can be checked at any later time by recomputing the checksum and...

 of the page. Because the value of this field changes the result of the check is computed with this field equal to zero.

Next, the 27th byte of each page specifies the number of segments it contains which ranges from 0 to 255. This is also the size of the following segment table in bytes. Each byte of the segment table provides the length of a segment.

Each segment can be up to 255 bytes in length and is bounded by the page. If a segment is less than 255 it marks the end of a packet, the next segment will begin a new packet. If a packet ends on a multiple of 255, it will end in a segment 0 bytes long. If the last segment of the page is 255 bytes then the last packet is continued on the following page.

Editing with pages

One of the common uses of Ogg pages is for editing Ogg
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.The Ogg container format can multiplex...

 files without the loss of quality or processing expense
Expense
In common usage, an expense or expenditure is an outflow of money to another person or group to pay for an item or service, or for a category of costs. For a tenant, rent is an expense. For students or parents, tuition is an expense. Buying food, clothing, furniture or an automobile is often...

 involved in transcoding.

Any series of pages within a stream can be preceded by the stream's header pages (pages with an absolute granule position of 0) and be decoded properly by media players. This technique can be used to losslessly crop a media file.

Multiple cropped segments can be appended to each other with a process known as chaining provided that the serial numbers of these segments are modified to unique numbers. New content can also be inserted between these segments.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK