Microsoft DirectX 9.0

Overview of MPEG-2 Systems

This section gives a general, non-technical overview of the MPEG-2 Systems layer. MPEG-2 Systems is the standard that defines how audio and video streams are multiplexed in MPEG-2. For more information, see the Moving Picture Experts Group home page.

Elementary Streams

MPEG-2 multiplexing starts with one or more byte streams, called elementary streams (ES), that contain video, audio, or other data. For example, a video ES contains compressed video frames, plus sequence headers, group-of-picture (GOP) headers, and anything else needed by the decoder to decode the stream. The Systems layer does not define the contents of the ES byte stream.

An elementary stream is broken up into packets, forming a packetized elementary stream (PES). PES packets have variable length. The contents of the packet are called the payload. Each PES packet also includes a header. The multiplexer assigns a 1-byte stream ID to every PES; individual PES packets are identified by the stream ID in the packet header. For audio streams, the stream ID has the form 110xxxxx. For video, the stream ID has the form 1110yyyy.

The MPEG-2 standard defines two ways to deliver packetized elementary streams: program streams and transport streams.

Program Streams

Program streams are designed for environments that are relatively error-free, such as local file storage. In a program stream, the PES packets are multiplexed and organized into units called packs. All of the PES streams in a program stream are synchronized to the same clock.

Transport Streams

Transport streams (TS) are designed for unreliable or error-prone environments, such as network broadcasts. Also, they can contain multiple programs that are synchronized to different clocks. A transport stream adds a second layer of packetizing — the PES streams are packaged inside transport stream packets, which have a fixed size of 188 bytes per packet. TS packets can also contain program information streams, which are described in the following section.

Each TS packet has a 4-byte header, plus an optional adaptation field that contains additional header information. The multiplexer assigns a program ID (PID) to each PES stream or program information stream. The PIDs are used to identify the TS packets, similar to the way stream IDs identify PES packets. (If a transport stream contains multiple programs, the stream IDs might not be unique, but the PID assignments are unique within the transport stream.)

Program Specific Information

Because a transport stream can carry multiple programs, there must be a way to associate the various PES packets with the programs they belong to. This is accomplished using tables that identify the program streams. Collectively, this data is called Program Specific Information (PSI). The PSI data is carried in TS packets, just like the PES data. There are various types of PSI data, including:

See Also