Sustainability of Digital Formats: Planning for Library of Congress Collections

Introduction | Sustainability Factors | Content Categories | Format Descriptions | Contact
Format Description Categories >> Browse Alphabetical List

Ogg File Format

>> Back
Table of Contents
Format Description Properties Explanation of format description terms

Identification and description Explanation of format description terms

Full name Ogg File Format
Description Wrapper format for Vorbis sound data and various other audiovisual bitstreams developed by the Xiph open source project. The Xiph Web site calls the format a "container" and also an "encapsulation format" ("version 0").
Production phase Generally used for final-state, end-user delivery.
Relationship to other formats
    Has subtype Ogg_Vorbis, Ogg Vorbis Audio Format
    Has subtype Ogg_FLAC_1_0, Ogg FLAC Audio Format, Version 1.0
    Has subtype Ogg_SPX, Ogg Speex Audio Format
    Has subtype Ogg Theora Video Format, not described at this time.

Local use Explanation of format description terms

LC experience or existing holdings The Library of Congress has a small amount of Ogg files in its collections.
LC preference See the Library of Congress Recommended Formats Statement for format preferences for Moving Image Works and Audio Works.

Sustainability factors Explanation of format description terms

Disclosure Fully documented. Developed by xiph as an open source and patent-free project.
    Documentation Menu to Ogg documentation; see also Ogg logical and physical bitstream overview and Ogg logical bitstream framing.
Adoption Ogg is the recommended format for audio and video on Wikimedia Commons because it is unencumbered by patents. Firefox 3.1 (in beta as of February 2009) has native support for the Ogg audio and video formats.
    Licensing and patents None.
Transparency The wrapper is transparent; the encodings it contains depend upon algorithms and tools to read and require sophistication to build tools.
Self-documentation Includes internal headers and identifiers (signifiers) for the technical information needed by player software. No provision for descriptive or administrative metadata was apparent; Comments welcome.
External dependencies None.
Technical protection considerations None known to the compilers of this document.

Quality and functionality factors Explanation of format description terms

Normal rendering See Ogg_Vorbis and Ogg_SPX.
Fidelity (high audio resolution) See Ogg_Vorbis and Ogg_SPX.
Multiple channels See Ogg_Vorbis and Ogg_SPX.
Support for user-defined sounds, samples, and patches See Ogg_Vorbis and Ogg_SPX.
Functionality beyond normal rendering Not investigated at this time.

File type signifiers and format identifiers Explanation of format description terms

Tag Value Note
Filename extension ogg
From The File Extension Source
Internet Media Type application/ogg
Cited type from Other types used for specific implementations; see Ogg_Vorbis and Ogg_SPX.
Internet Media Type audio/x-ogg
From The File Extension Source.
Magic numbers Hex: 4F 67 67 53 00 02 00 00 00 00 00 00 00 00
From The File Extension Source. See also Notes below.
Pronom PUID fmt/944
Wikidata Title ID Q188199

Notes Explanation of format description terms


From The Ogg Encapsulation Format Version 0:

The fields in the page header have the following meaning:

  • 1. capture_pattern: a 4 Byte field that signifies the beginning of a page. It contains the magic numbers:
    0x4f 'O'
    0x67 'g'
    0x67 'g'
    0x53 'S'
    It helps a decoder to find the page boundaries and regain synchronisation after parsing a corrupted stream. Once the capture pattern is found, the decoder verifies page sync and integrity by computing and comparing the checksum.
  • 2. stream_structure_version: 1 Byte signifying the version number of the Ogg file format used in this stream (this document specifies version 0).
  • 3. header_type_flag: the bits in this 1 Byte field identify the specific type of this page.
    • bit 0x01
      set: page contains data of a packet continued from the previous page
      unset: page contains a fresh packet
    • bit 0x02
      set: this is the first page of a logical bitstream (bos)
      unset: this page is not a first page
    • bit 0x04
      set: this is the last page of a logical bitstream (eos)
      unset: this page is not a last page
  • 4. granule_position: an 8 Byte field containing position information. For example, for an audio stream, it MAY contain the total number of PCM samples encoded after including all frames finished on this page. For a video stream it MAY contain the total number of video frames encoded after this page. This is a hint for the decoder and gives it some timing and position information. Its meaning is dependent on the codec for that logical bitstream and specified in a specific media mapping. A special value of -1 (in two's complement) indicates that no packets finish on this page.
  • 5. bitstream_serial_number: a 4 Byte field containing the unique serial number by which the logical bitstream is identified.
  • 6. page_sequence_number: a 4 Byte field containing the sequence number of the page so the decoder can identify page loss. This sequence number is increasing on each logical bitstream separately.
  • 7. CRC_checksum: a 4 Byte field containing a 32 bit CRC checksum of the page (including header with zero CRC field and page content). The generator polynomial is 0x04c11db7.
  • 8. number_page_segments: 1 Byte giving the number of segment entries encoded in the segment table.
  • 9. segment_table: number_page_segments Bytes containing the lacing values of all segments in this page. Each Byte contains one lacing value.

The total header size in bytes is given by: header_size = number_page_segments + 27 [Byte]
The total page size in Bytes is given by: page_size = header_size + sum(lacing_values: 1..number_page_segments) [Byte]


Format specifications Explanation of format description terms

Useful references


Last Updated: 04/24/2023