Ogg carries more than audio codecs. The first bytes of a stream’s first packet identify it. These are the other stream types the explorer names. Video and text streams are named and their headers shown, but not decoded.
Stream types
| First bytes | Stream | What it is |
|---|---|---|
0x80 theora | Theora | video, from On2’s VP3 |
fishead\0 | Ogg Skeleton | metadata about the other streams and their timing; fisbone\0 and index\0 packets give each stream’s details and seek indexes |
BBCD\0 | Dirac | video, in Dirac (VC-2) sequence framing |
0x80 kate\0\0\0 | Kate | karaoke and text overlay streams |
PCM | OggPCM | uncompressed PCM audio |
CELT | CELT | the codec before it became a layer of Opus |
OVP80 | VP8 | video |
OggMIDI\0 | OggMIDI | MIDI data |
0x01 video, audio or text | OGM | Ogg Media streams, an older DirectShow-based extension for AVI-style video |
Annodex\0, CMML\0\0\0\0 | Annodex, CMML | timed annotations, from the Annodex project |
YUV4MPEG | YUV4MPEG | raw video frames |
Theora identification header
The first packet of a Theora stream is 42 bytes. Numbers are big-endian.
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 1 | header type | 0x80; 0x81 is the comment and 0x82 the setup header |
| 1 | 6 | codec name | theora |
| 7 | 1 | VMAJ | major version |
| 8 | 1 | VMIN | minor version |
| 9 | 1 | VREV | revision |
| 10 | 2 | FMBW | frame width, in 16-pixel macroblocks |
| 12 | 2 | FMBH | frame height, in macroblocks |
| 14 | 3 | PICW | picture width in pixels |
| 17 | 3 | PICH | picture height in pixels |
| 20 | 1 | PICX | picture X offset |
| 21 | 1 | PICY | picture Y offset |
| 22 | 4 | FRN | frame rate numerator |
| 26 | 4 | FRD | frame rate denominator |
| 30 | 3 | PARN | pixel aspect numerator |
| 33 | 3 | PARD | pixel aspect denominator |
| 36 | 1 | CS | colour space: 0 undefined, 1 Rec. 470 M, 2 Rec. 470 B/G |
| 37 | 3 | NOMBR | nominal bit rate |
| 40 | 6 bits | QUAL | quality hint |
| 40 | 5 bits | KFGSHIFT | the shift used in granule positions |
| 41 | 2 bits | PF | pixel format: 0 is 4:2:0, 2 is 4:2:2, 3 is 4:4:4, 1 reserved |
| 41 | 3 bits | reserved | zero |
A Theora stream has three header packets (identification, comment and setup) before its video packets. Its comment packet uses the same Vorbis comment structure, without a framing bit.
Links
- Theora specification – the Xiph.Org Foundation’s full description (PDF)