- MPEG transport stream
MPEG Transport Stream Filename extension
Internet media type
Developed by MPEG Initial release 1995 Type of format Media container Container for Audio, video, data Extended to M2TS, TOD Standard(s) ISO/IEC 13818-1, ITU-T Recommendation H.222.0
MPEG transport stream (TS) is a standard format for transmission and storage of audio, video, and Program and System Information Protocol (PSIP) data, and is used in broadcast systems such as DVB and ATSC.
Transport stream specifies a container format encapsulating packetized elementary streams, with error correction and stream synchronization features for maintaining transmission integrity when the signal is degraded.
Transport streams differ from the similarly named Program Streams in several important ways: Program Streams, also called PS, are designed for reasonably reliable media, such as discs (like DVDs), while TS is designed for less reliable transmission, namely terrestrial or satellite broadcast. Further, a Transport Stream may carry multiple Programs.
- 1 Layers of communication
- 2 Important elements of a transport stream
- 3 Modifications of transport stream specification for random-access media (M2TS)
- 4 See also
- 5 Programs that open TS files
- 6 References
- 7 External links
Layers of communication
- 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) — providing random access points
- Slice — preventing an error from being propagated through intra prediction
- Macroblock—consisting of 6 to 12 DCT blocks
- Encoding block or just block—a DCT encoding block, 8x8 pixels
Important elements of a transport stream
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 Packet Identifier (PID). This is followed by a 4-bit continuity counter. Additional optional transport fields, as signaled in the optional adaptation field, may follow. The rest of the packet consists of payload. Packets are 188 bytes in length , but the communication medium may add some error correction bytes to the packet. ISDB-T and DVB-T/C/S uses 204 bytes and ATSC 8-VSB, 208 bytes as the size of emission packets (transport stream packet + FEC data). ATSC transmission adds 20 bytes of Reed-Solomon forward error correction to create a packet that is 208 bytes long. The 188-byte packet size was originally chosen for compatibility with ATM systems.
Partial Transport Stream Packet Format Name Number
Description sync byte 8 0x47 Transport Error Indicator (TEI) 1 Set by demodulator if can't correct errors in the stream, to tell the demultiplexer that the packet has an uncorrectable error  Payload Unit Start Indicator 1 1 means start of PES data or PSI otherwise zero only. Transport Priority 1 1 means higher priority than other packets with the same PID. PID 13 Packet ID Scrambling control 2 '00' = Not scrambled. The following per DVB spec: '01' = Reserved for future use, '10' = Scrambled with even key, '11' = Scrambled with odd key Adaptation field exist 2 01 = no adaptation fields, payload only
10 = adaptation field only
11 = adaptation field and payload
Continuity counter 4 Incremented only when a payload is present (i.e., adaptation field exist is 01 or 11) Note: the total number of bits above is 32 and is called the transport stream 4-byte prefix or Transport Stream Header. Adaptation field 0 or more Depends on flags Payload Data 0 or more Depends on flags Adaptation Field Format Name Number
Description Adaptation Field Length 8 Number of bytes in the adaptation field immediately following this byte Discontinuity indicator 1 Set to 1 if current TS packet is in a discontinuity state with respect to either the continuity counter or the program clock reference Random Access indicator 1 Set to 1 if the PES packet in this TS packet starts a video/audio sequence Elementary stream priority indicator 1 1 = higher priority PCR flag 1 1 means adaptation field does contain a PCR field OPCR flag 1 1 means adaptation field does contain an OPCR field Splicing point flag 1 1 means presence of splice countdown field in adaptation field Transport private data flag 1 1 means presence of private data bytes in adaptation field Adaptation field extension flag 1 1 means presence of adaptation field extension Below fields are optional variable Depends on flags PCR 33+9 Program clock reference, stored in 6 octets in big-endian as 33 bits base, 6 bits padding, 9 bits extension. OPCR 33+9 Original Program clock reference. Helps when one TS is copied into another Splice countdown 8 Indicates how many TS packets from this one a splicing point occurs (may be negative) stuffing bytes variable
Each table or elementary stream in a transport stream is identified by a 13-bit packet ID (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.
Transport stream has a concept of programs. Each single program is described by a Program Map Table (PMT) which has a unique PID, and the elementary streams associated with that program have PIDs listed in the PMT. 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 decode a particular "channel" merely has to decode the payloads of each PID associated with its program. It can discard the contents of all other PIDs. A transport stream with more than one program is referred to as MPTS - Multi Program Transport Stream. A single program transport stream is referred to as SPTS - Single Program Transport Stream.
Program Specific Information (PSI)
There are 4 PSI tables: Program Association (PAT), Program Map (PMT), Conditional Access (CAT), and Network Information (NIT). The MPEG-2 specification does not specify the format of the CAT and NIT.
PAT stands for Program Association Table. It lists all programs available in the transport stream. Each of the listed programs is identified by a 16-bit value called program_number. Each of the programs listed in PAT has an associated value of PID for its Program Map Table (PMT).
The value 0x0000 of program_number is reserved to specify the PID where to look for Network Information Table (NIT). If such a program is not present in PAT the default PID value (0x0010) shall be used for NIT.
TS Packets containing PAT information always have PID 0x0000.
Program Map Tables (PMTs) contain information about programs. For each program, there is one PMT. While the MPEG-2 standard permits more than one PMT section to be transmitted on a single PID, most MPEG-2 "users" such as ATSC and SCTE require each PMT to be transmitted on a separate PID that is not used for any other packets. The PMTs provide information on each program present in the transport stream, including the program_number, and list the elementary streams that comprise the described MPEG-2 program. There are also locations for optional descriptors that describe the entire MPEG-2 program, as well as an optional descriptor for each elementary stream. Each elementary stream is labeled with a stream_type value.
To enable a decoder to present synchronized content, such as audio tracks matching the associated video, at least once each 100 ms a Program Clock Reference, or PCR is transmitted in the adaptation field of an MPEG-2 transport stream packet. The PID with the PCR for an MPEG-2 program is identified by the pcr_pid value in the associated Program Map Table. The value of the PCR, when properly used, is employed to generate a system_timing_clock in the decoder. The STC decoder, when properly implemented, provides a highly accurate time base that is used to synchronize audio and video elementary streams. Timing in MPEG2 references this clock, for example the presentation time stamp (PTS) is intended to be relative to the PCR. The first 33 bits are based on a 90 kHz clock. The last 9 are based on a 27 MHz clock. The maximum jitter permitted for the PCR is +/- 500 ns.
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 not contain any data at all, and the receiver is expected to ignore its contents.
Modifications of transport stream specification for random-access media (M2TS)
Transport Stream had been originally designed for broadcast. Later it was adapted for usage with digital video cameras, recorders and players by adding a 4-byte timecode (TC) to standard 188-byte packets, which resulted in a 192-byte packet. This is what is informally called M2TS stream. Blu-ray Disc Association calls it "BDAV MPEG-2 transport stream". JVC called it TOD (possibly an abbreviation for "Transport stream on disc") when used in HDD-based camcorders like GZ-HD7. M2TS transport stream is also used for recording HDV video (onto tape and onto file-based media), and for AVCHD video files, which often have MTS extension. The timecode allows quick access to any part of the stream either from a media player, or from a non-linear video editing system. It is also used to synchronize video streams from several cameras in a multi-camera shoot.
Filename extension .m2ts is used on Blu-ray Disc Video for files which contain BDAV MPEG-2 transport stream. Blu-ray Disc Video titles authored with menu support are in the BDMV (Blu-ray Disc Movie) format and contain audio, video, and other streams in BDAV container, which is based on the MPEG-2 transport stream format. There is also the BDAV (Blu-ray Disc Audio/Visual) format, the consumer oriented alternative to the BDMV format used for movie releases. The BDAV format is used on BD-REs and BD-Rs for audio/video recording. Blu-ray Disc employs the MPEG-2 transport stream recording method. That enables transport streams of digital broadcasts to be recorded as they are without altering the format. It also enables flexible editing of a digital broadcast that is recorded as is and where the data can be edited just by rewriting the playback stream. Although it is quite natural, a function for high-speed and easy-to use retrieval is built in. Blu-ray Disc Video use MPEG-2 transport streams, compared to DVD's program streams. This allows multiple video programs to be stored in the same file so they can be played back simultaneously (e.g. with "Picture in picture" effect).
- ATSC tuner
- Digital Video Broadcasting (DVB)
- Elementary stream
- MPEG program stream
- Packetized elementary stream
- Program and System Information Protocol
- Unidirectional Lightweight Encapsulation (ULE)
Programs that open TS files
- Windows Media Player 12 
Mac OS X
- ^ "RFC 3555 - MIME Type Registration of RTP Payload Formats". 2003-07. http://tools.ietf.org/html/rfc3555#page-38. Retrieved 2010-03-20.
- ^ ITU-T (July 1995). "Recommendation H.222.0 (07/95) - Superseded". http://www.itu.int/rec/T-REC-H.222.0-199507-S/en. Retrieved 2010-07-18.
- ^ a b ITU-T (2006-05). "H.222.0 Summary". http://www.itu.int/dms_pubrec/itu-t/rec/h/T-REC-H.222.0-200605-I!!SUM-HTM-E.htm. Retrieved 2010-06-03.
- ^ a b ITU-T. "H.222.0 : Information technology - Generic coding of moving pictures and associated audio information: Systems". http://www.itu.int/rec/T-REC-H.222.0. Retrieved 2010-06-03.
- ^ a b c (PDF) ISO/IEC 13818-1:2000 - Information technology -- Generic coding of moving pictures and associated audio information: Systems, neuron2.net, 2000-12-01, http://neuron2.net/library/mpeg2/iso13818-1.pdf, retrieved 2010-06-03
- ^ ISO (1996). "ISO/IEC 13818-1:1996 - Information technology -- Generic coding of moving pictures and associated audio information: Systems". http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=22989. Retrieved 2010-07-18.
- ^ "MPEG-2 Transport Stream". AfterDawn.com. http://www.afterdawn.com/glossary/term.cfm/mpeg2_transport_stream. Retrieved 2010-06-08.
- ^ ATSC transmission
- ^ MPEG Systems FAQ
- ^ Tektronix: Products > ATSC MPEG Transport Stream Monitor - AT970: Characteristics/Specs
- ^ TSReader Support
- ^ DVB scrambling control bits defined. Page 6
- ^ ISO (2000-12-01). "Continuity Counter Explained". p. 38. Archived from the original on 2009-03-26. http://replay.waybackmachine.org/20090326214853/http://neuron2.net/library/mpeg2/iso13818-1.pdf. Retrieved 2011-03-07.
- ^ a b c Blu-ray Disc Association (March 2005) BD ROM - Audio Visual Application Format Specifications (PDF) Page 15, Retrieved on 2009-07-26
- ^ a b c Blu-ray Disc Association (March 2008) BD-RE - Audiovisual Application Format Specification for BD-RE 2.1 (PDF), Technical White Papers - BD RE, Retrieved on 2009-07-28
- ^ "Steve Mullen, M2TS primer". http://dvinfo.net/conf/showthread.php?t=105486.
- ^ Working with JVC Everio MOD & TOD files, Retrieved on 2009-07-27
- ^ Backing up AVCHD video onto DVDs and playing them on a Blu-ray player, Retrieved on 2009-07-27
- ^ How MPEG-TS works, videohelp.com
- ^ Videohelp.com What is Blu-ray Disc and HD DVD?, Retrieved on 2009-07-26
- ^ AfterDawn.com Glossary - BD-MV (Blu-ray Movie) and BDAV container, Retrieved on 2009-07-26
- ^ a b AfterDawn.com Glossary - BDAV container, Retrieved on 2009-07-26
- ^ Blu-ray Disc Association (August 2004) Blu-ray Disc Format, White paper (PDF) Page 22, Retrieved on 2009-07-28
- ^ "FFmpeg Changelog". ffmpeg.org. http://ffmpeg.org/changelog.html. Retrieved 10 June 2010. "version 0.4.6: [~snip~] added MPEG-2 TS demuxer"
- ^ mplayer(1)
- ^ "VLC playback Features". videolan.org. http://www.videolan.org/vlc/features.html. Retrieved 10 June 2010. "Input formats: MPEG (ES,PS,TS,PVA,MP3) [~snip~]"
- ^ http://msdn.microsoft.com/en-us/windows/dd239181.aspx
- MPEG-2 Systems FAQ
- MPEG-4 Systems FAQ
- MPEG-1 description
- DVB Overview: Introduction to MPEG-2 Compression and Transport Stream (PowerPoint Presentation)
- MPEG-2.PPT (PowerPoint Presentation)
- MPEG-2 Transport Stream
- An example of live DVB-T transport stream analysis
Multimedia compression and container formats VideoOthers AudioOthersAC-3 · AMR · AMR-WB · AMR-WB+ · Apple Lossless · Asao · ATRAC · CELT · DRA · DTS · EVRC · EVRC-B · FLAC · GSM-HR · GSM-FR · GSM-EFR · iLBC · iSAC · Monkey's Audio · TTA (True Audio) · MT9 · A-law · μ-law · Musepack · OptimFROG · Opus · OSQ · QCELP · RealAudio · RTAudio · SD2 · SHN · SILK · Siren · SMV · Speex · SVOPC · TwinVQ · VMR-WB · Vorbis · WavPack · WMA ImageOthers ContainersISO/IECITU-TOthersSee Compression methods for methods and Compression software implementations for codecs MPEG-1 Parts MPEG-2 Parts MPEG-4 Parts MPEG-7 Parts MPEG-21 PartsParts 2, 3 and 9: Digital Item · Part 5: Rights Expression Language MPEG-D PartsPart 1: MPEG Surround · Part 3: Unified Speech and Audio Coding
Wikimedia Foundation. 2010.