An OGG bitstream is a sequence of pages, each carrying lacing-delimited packet segments; the format is little-endian throughout -- the reverse of MP4 and AIFF. A logical packet may span many pages; the segment table encodes boundaries without explicit lengths. Hover a field to light its bytes, click a + for its table. Color marks kind (see the key). * the one trap: OGG is little-endian everywhere, including all multi-byte fields in the page header.
Every page in a physical OGG stream has this layout, repeated end-to-end.
capture_pattern through page_segments. The 27-byte fixed portion before the segment table. See the byte map below.
Raw codec payload packed continuously. The segment table above tells the decoder where each logical packet ends.
27 bytes. Example: first BOS page, header_type 0x02, granule -1 (no packet completes), serial 1, page 0, one segment.
1 byte, bit register. Example: 0x02 -- BOS set, EOS and continued-packet clear. Bits indexed MSB-first.
The segment table encodes packet boundaries without a separate length field.
The payload of the first (BOS) page carries a codec identification header. A reader identifies the codec before any other decode.