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

How Parsers Detect PES Packets

When demuxing or inspecting a VOB file:

  1. The parser scans the byte stream for the 24-bit pattern 0x000001.
  2. It reads the subsequent byte (the Stream ID). If the byte is greater than or equal to 0xBC (with the exception of padding stream 0xBE), it signals the beginning of a valid PES packet header.
  3. The next two bytes immediately following the Stream ID indicate the total length of the PES packet.