Ogg යනු Xiph.Org පදනම විසින් පවත්වාගෙන යනු ලබන නිදහස්, විවෘත සම්මත බඳුන් ආකෘතියකි. Ogg ආකෘතියේ නිර්මාපකයෝ state that it is unrestricted by software patents and is designed to provide for efficient streaming and manipulation of high quality digital multimedia.
In the Ogg multimedia framework, Theora provides a lossy video layer. The audio layer is most commonly provided by the music-oriented Vorbis format but other options include the human speech compression codec Speex, the lossless audio compression codec 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 (including Theora), and .ogx for multiplexed Ogg.
As of December 7, 2010, the current version of the Xiph.Org Foundation's reference implementation, is libogg 1.2.2. Another version, libogg2, has been in development, but is awaiting a rewrite as of 2008. 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 non-copylefted, 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.
පහත දැක්වෙනුයේ Ogg පිටු ශ්රීර්ෂකයක ක්ෂේත්ර සැලැස්මකි:
- Capture pattern – 32 bits
- The capture pattern or sync code is a magic number used to ensure synchronisation when parsing Ogg files. Every page starts with the four ASCII character sequence OggS. This assists in resynchronising a parser in cases where data has been lost or is corrupted, and is a sanity check before commencing parsing 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. The rightmost or least significant bit is considered bit 0, with value 0x01, the next least significant digit is bit 1, with value 0x02. The third is bit 2, with value 0x04, and so on.
Bit Value Flag 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 checksum of the data in the entire page, performed with the checksum field set to 0. This allows verification that the data has not been corrupted since it was created. Pages that fail the checksum should be discarded.
- 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 8 bit vector of values indicating the length of each 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.