MPEG transport stream
MPEG transport stream or simply transport stream is a standard digital container format for transmission and storage of audio, video, and Program and System Information Protocol data. It is used in broadcast systems such as DVB, ATSC and IPTV.
Transport stream specifies a container format encapsulating packetized elementary streams, with error correction and synchronization pattern features for maintaining transmission integrity when the communication channel carrying the stream is degraded.
Transport streams differ from the similarly-named MPEG program stream in several important ways: program streams are designed for reasonably reliable media, such as discs, while transport streams are designed for less reliable transmission, namely terrestrial or satellite broadcast. Further, a transport stream may carry multiple programs.
Transport stream is specified in MPEG-2 Part 1, Systems, formally known as ISO/IEC standard 13818-1 or ITU-T Rec. H.222.0.
Overview
A transport stream encapsulates a number of other substreams, often packetized elementary streams which in turn wrap the main data stream using the MPEG codec or any number of non-MPEG codecs, text and pictures for subtitles, tables identifying the streams, and even broadcaster-specific information such as an electronic program guide. Many streams are often mixed together, such as several different television channels, or multiple angles of a movie.Each stream is chopped into 188-byte sections and interleaved together; because of the tiny packet size, streams can be interleaved with less latency and greater error resilience compared to program streams and other common containers such as AVI, MOV/MP4, and MKV, which generally wrap each frame into one packet. This is particularly important for videoconferencing, where large frames may introduce unacceptable audio delay.
Transport streams tend to be broadcast as constant bitrate and filled with padding bytes when not enough data exists.
Elements
Packet
A network packet is the basic unit of data in a transport stream, and a transport stream is merely a sequence of packets. Each packet starts with a sync byte and a header, that may be followed with optional additional headers; the rest of the packet consists of payload. All header fields are read as big-endian. Packets are 188 bytes in length, but the communication medium may add additional information. The 188-byte packet size was originally chosen for compatibility with Asynchronous Transfer Mode systems.Packet identifier (PID)
Each table or elementary stream in a transport stream is identified by a 13-bit packet identifier. 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.Decimal | Hexadecimal | Description |
0 | 0x0000 | Program association table contains a directory listing of all program map tables |
1 | 0x0001 | Conditional access table contains a directory listing of all ITU-T Rec. H.222 entitlement management message streams used by program map tables |
2 | 0x0002 | Transport stream description table contains descriptors relating to the overall transport stream |
3 | 0x0003 | IPMP control information table contains a directory listing of all ISO/IEC 14496-13 control streams used by program map tables |
4–15 | 0x0004-0x000F | Reserved for future use |
16–31 | 0x0010-0x001F | Used by DVB metadata
|
32-8186 | 0x0020-0x1FFA | May be assigned as needed to program map tables, elementary streams and other data tables |
8187 | 0x1FFB | Used by DigiCipher 2/ATSC MGT metadata |
8188–8190 | 0x1FFC-0x1FFE | May be assigned as needed to program map tables, elementary streams and other data tables |
8191 | 0x1FFF | Null Packet |