MPEG transport stream
From Wikipedia, the free encyclopedia
Transport stream (TS, TP, or MPEG-TS) is a format specified in MPEG-2 Part 1, Systems (ISO/IEC standard 13818-1). Its design goal is to allow multiplexing of digital video and audio and to synchronize the output. Transport stream offers features for error correction for transportation over unreliable media, and is used in broadcast applications such as DVB and ATSC. It is contrasted with program stream, designed for more reliable media.
Contents |
[edit] Layers of communication
Similar to the ISO network protocol stack, a transport stream is processed by the receiver in layers. An example stream containing video may be processed as follows:
- Composition of the various programs.
- Packetized Elementary Stream (PES)
- Elementary stream (ES) - audio or video (the below is for video only)
- Group of pictures (GOP)
- Slice - Lowest layer that encoder can change DCT coding values to manage bit rate
- Macroblock - Consisting of 4 DCT blocks
- Encoding block or just block - A DCT encoding block, 8x8 luminance pixels
An example of data that is muxed into the transport stream is an electronic program guide. See Program and System Information Protocol for more information.
[edit] Important elements of a transport stream
[edit] Packet
A packet is the basic unit of data in a transport stream. It consists of a sync byte, whose value is 0x47, followed by three one-bit flags and a 13-bit PID. This is followed by a 4-bit continuity counter. Additional optional transport fields, as signalled in the optional adaptation field, may follow. The rest of the packet consists of payload. Packets are most often 188 bytes in length, but some transport streams consist of 204-byte packets which end in 16 bytes of Reed-Solomon error correction data. The 188-byte packet size was originally chosen for compatibility with ATM systems[1].
[edit] PID
Each table or elementary stream in a transport stream is identified by a 13-bit PID. A demultiplexer extracts elementary streams from the transport stream in part by looking for packets identified by the same PID. In most applications, Time-division multiplexing will be used to decide how often a particular PID appears in the transport stream.
[edit] Programs
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. It can discard the contents of all other PIDs.
[edit] PAT
PAT stands for Program Association Table. The PAT lists PIDs for all PMTs in the stream. Packets containing PAT information always have PID 0x0.
[edit] PMT
Program Map Tables, or PMTs, 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). The PMT may also contain additional descriptors providing data about its constituent streams.
[edit] PCR
To assist the decoder in presenting programs on time, at the right speed, and with synchronization, programs usually periodically provide a Program Clock Reference, or PCR, on one of the PIDs in the program.
[edit] Null packets
Some transmission schemes, such as those in ATSC and DVB, impose strict constant bitrate requirements on the transport stream. In order to ensure that the stream maintains a constant bitrate, a Multiplexer may need to insert some additional packets. The PID 0x1FFF is reserved for this purpose. The payload of null packets may contain any data at all, and the receiver is expected to ignore its contents.
[edit] See also
- ATSC tuner
- DVB
- Elementary stream
- IPTV
- MPEG-2
- Packetized Elementary Stream
- Program and System Information Protocol
- Unidirectional Lightweight Encapsulation (ULE)
[edit] Sample of tools available
Software: Analyzer, Speedometer, Muxer, dvb-snoop, ATSC Transport Stream Tools for Linux, Tools, Ethereal MPEG-2 TS Dissector,
Hardware: Monitor, TS Distributor, Assorted, ODG - Open DVB Gateway
[edit] External links
- MPEG-2 Systems FAQ
- MPEG-4 Systems FAQ
- MPEG-1 description
- Powerpoint MPEG-2 Transport Stream introduction
- Splicing FAQ
Categories: ATSC | MPEG