240 likes | 580 Views
MPEG-2 Transport streams. The MPEG-2 Systems Standard specifies two methods for multiplexing the audio, video and other data into a format suitable for transmission and storage, namely the program stream and the transport stream.
E N D
MPEG-2 Transport streams • The MPEG-2 Systems Standard specifies two methods for multiplexing the audio, video and other data into a format suitable for transmission and storage, namely the program stream and the transport stream. • The Program Stream is designed for applications where errors are unlikely. • It contains audio, video and data bitstreams (also called elementary bitstreams) all merged into a single bitstream. tMyn
The program stream, as well as each of the elementary bitstreams, may be a fixed or variable bit rate. • DVDs use program streams, carrying the DVD-specific data in private data streams interleaved with the various video and audio streams. • The Transport Stream, using fixed-size packets of 188 bytes, is designed for applications where data loss is likely. • Also containing audio, video and data bitstreams all merged into a single bitstream, multiple programs can be carried. tMyn
The DVB and ATSC digital television standards use transport streams. • Both the Transport Stream and Program Stream are based on a common packet structure, facilitating common decoder implementations and conversions. • Both streams are designed to support a large number of known and anticipated applications, while retaining flexibility. tMyn
The MPEG-2 system layer includes a mechanism for combining MPEG encoded video and audio with associated data signals into transport streams. • It can also allow the combination of any number of different programs in to a single MPEG-2 transport stream. • A very important part of the system layer is the clock reference information, which is used to enable the recovery of individual video and audio clocks. • With MPEG-2 encoding there can be variable delays experienced for video and audio signals due to variable length coding. tMyn
The system layer includes decoding time stamps (DTS) and presentation time stamps (PTS) which help to ensure the delay is consistent, and that the video, audio, and data are kept in synchronization even though the signals are packetized. • The system layer also provides useful information about the actual transmission network itself (Network Information Table), about the programs being carried (Program Allocation Tables), and finally Conditional Access Tables which reference scrambled or encrypted services. • These facilities allow a decoder select a particular television service from the services being delivered to the consumer at any particular time. tMyn
In Figure 1 a conceptual single service MPEG-2 TS multiplexer is shown. • The video, audio, and data elements are encoded and packetized separately. • Then the resulting packets are combined together to form a transport stream. • Elementary streams (ES) are the most basic type of MPEG-2 signals and are generated by the encoder. They are separate data streams for video, audio, and data signals. tMyn
MPEG-2 Elementary Encoder Video source Packetizer MPEG-2 Elementary Encoder Audio source PES Packetizer Systems layer MUX Data source Packetizer PES PSI CLOCK Figure 1. An MPEG-2 multiplexer. tMyn
Packetized elementary streams (PES) are variable length packets of data which also contain stamps and header information. They are separate data streams for video, audio, and data signals. • The structure of an MPEG-2 PES is shown in Figure 2. • Program Clock Reference (PCR) is a reference for the 27 MHz clock regeneration and is transmitted at least every 0,1 second. • Program Specific Information (PSI) is data transmitted in the TS for the receiver demultiplexer. tMyn
A typical MPEG-2 TS packet structure is shown in Figure 3. • A packet is the basic unit of data in a transport stream. It consists of a sync byte, followed by three one-bit flags and a 13-bit PID. 4 bytes 184 bytes Figure 3. MPEG-2 TS packet structure. tMyn
This is followed by a 4-bit continuity counter. • Additional optional transport fields may follow. • The rest of the packet consists of payload. • Packets are most often 188 bytes in length. • Each elementary stream in a transport stream is identified by a 13-bit PID, Packet Identification. • A demultiplexer extracts elementary streams from the transport stream in part by looking for packets identified by the same PID. tMyn
Transport stream has a concept of programs, which are groups of one or more PIDs that are related to each other. • For instance, a transport stream used in digital television might contain three programs, to represent three television channels. Suppose each channel consists of one video stream, one or two audio streams, and any necessary metadata. A receiver wishing to tune to a particular channel merely has to decode the payload of the PIDs associated with its program. • PAT stands for Program Association Table. The PAT lists for all PMTs in the stream. tMyn
Program Map Tables (PMT) contain information about programs. • For each program, there is a PMT, with the PMT for each program appearing on its own PID. • The PMTs describe which PIDs contain data relevant to the program. • PMTs also provide metadata about the streams in their constituent PIDs. For example, if a program contains an MPEG-2 video stream, the PMT will list this PID, describe it as a video stream, and provide the type of video that it contains (in this case, MPEG-2). tMyn
To assist the decoder in presenting programs on time, at the right speed, and with synchronization, programs usually periodically provide a Program Clock Reference, PCR, on one of the PIDs in the program. tMyn