PES Packet Header Start Code in VOB Files
This article explains the specific byte sequence used to denote the start of a Packetized Elementary Stream (PES) packet header within a VOB (Video Object) container. It breaks down the standard MPEG-2 Program Stream start code prefix, how the stream identifier completes the sequence, and how these bytes function inside DVD VOB files.
The PES Header Start Byte Sequence
In a VOB container—which is based on the standard MPEG-2 Program Stream (ISO/IEC 13818-1) format—the start of a PES packet header is denoted by a 3-byte prefix:
0x00 0x00 0x01 (hexadecimal)
In binary format, this sequence is:
00000000 00000000 00000001
The Complete 4-Byte Start Code
While 0x00 0x00 0x01 represents the PES start code
prefix, an actual PES packet header is always identified by a 4-byte
sequence consisting of the 3-byte prefix followed immediately by a
1-byte Stream ID:
0x00 0x00 0x01 [Stream ID]
The Stream ID specifies the elementary stream type and stream number carrying the payload.
Common Stream IDs Found in VOB Files
0xE0to0xEF(MPEG Video): The sequence0x00 0x00 0x01 0xE0denotes the start of primary MPEG-2 video packets.0xBD(Private Stream 1): The sequence0x00 0x00 0x01 0xBDis widely used in VOB files for non-MPEG audio formats (such as AC-3, DTS, and LPCM) as well as DVD sub-picture (subtitle) streams.0xC0to0xDF(MPEG Audio): The sequence0x00 0x00 0x01 0xC0through0xDFdenotes MPEG-1 or MPEG-2 audio streams.0xBF(Private Stream 2): The sequence0x00 0x00 0x01 0xBFdenotes DVD navigation packs (PCI and DSI packets).
How Parsers Detect PES Packets
When demuxing or inspecting a VOB file:
- The parser scans the byte stream for the 24-bit pattern
0x000001. - It reads the subsequent byte (the Stream ID). If the byte is greater
than or equal to
0xBC(with the exception of padding stream0xBE), it signals the beginning of a valid PES packet header. - The next two bytes immediately following the Stream ID indicate the total length of the PES packet.