MPEG transport stream

Last updated
MPEG Transport Stream
Filename extension
.ts, .tsv, .tsa, .m2t [1]
Internet media type
video/MP2T [2]
Uniform Type Identifier (UTI) public.mpeg-2-transport-stream [3]
Developed by MPEG
Initial release10 July 1995;28 years ago (1995-07-10) [4]
Latest release
ISO/IEC 13818-1:2022
September 2022;1 year ago (2022-09)
Type of format Container format
Container for Audio, video, data
Extended to M2TS, TOD
Standard ISO/IEC 13818-1, ITU-T Recommendation H.222.0 [4]
Open format?Yes
Free format?Yes [5]

MPEG transport stream ( MPEG-TS, MTS) or simply transport stream (TS) is a standard digital container format for transmission and storage of audio, video, and Program and System Information Protocol (PSIP) data. [6] It is used in broadcast systems such as DVB, ATSC and IPTV.

Contents

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 (like DVDs), 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. [4]

Overview

Multiple MPEG programs are combined then sent to a transmitting antenna. The receiver parses and decodes one of the streams. MPEG Transport Stream HL.svg
Multiple MPEG programs are combined then sent to a transmitting antenna. The receiver parses and decodes one of the streams.

A transport stream encapsulates a number of other substreams, often packetized elementary streams (PESs) which in turn wrap the main data stream using the MPEG codec or any number of non-MPEG codecs (such as AC3 or DTS audio, and MJPEG or JPEG 2000 video), 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 (at most) 188-byte sections and interleaved together. Due to 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 (CBR) and filled with padding bytes when not enough data exists. [lower-alpha 1]

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. [lower-alpha 2] The 188-byte packet size was originally chosen for compatibility with Asynchronous Transfer Mode (ATM) systems. [8] [9]

Partial transport stream packet format
NameNumber of bits Bitmask (big-endian)Description
4-byte Transport Stream Header
Sync byte 80xff000000Bit pattern of 0x47 (ASCII char 'G')
Transport error indicator (TEI)10x800000Set when a demodulator can't correct errors from FEC data; indicating the packet is corrupt. [10]
Payload unit start indicator (PUSI)10x400000Set when this packet contains the first byte of a new payload unit. For PSI packet data, the first byte of the payload will indicate where this new payload unit starts. For PES packet data, the new PES packet shall start at the start of the payload. [11]

This field allows a receiver that started reading mid transmission to know when it can start extracting data.

Transport priority10x200000Set when the current packet has a higher priority than other packets with the same PID.
PID130x1fff00Packet Identifier, describing the payload data.
Transport scrambling control (TSC)20xc0'00' = Not scrambled.

For DVB-CSA and ATSC DES only: [12]
'01' (0x40) = Reserved for future use
'10' (0x80) = Scrambled with even key
'11' (0xC0) = Scrambled with odd key

Adaptation field control20x3001 – no adaptation field, payload only,

10 – adaptation field only, no payload,
11 – adaptation field followed by payload,
00 – RESERVED for future use [13]

Continuity counter40xfSequence number of payload packets (0x00 to 0x0F) within each stream (except PID 8191)
Incremented per-PID, only when a payload flag is set.
Optional fields
Adaptation fieldvariablePresent if adaptation field control is 10 or 11. See below for format.
Payload datavariablePresent if adaptation field control is 01 or 11. Payload may be PES packets, program specific information (below), or other data.
Adaptation field format
NameNumber of bitsBitmaskDescription
Adaptation field length8Number of bytes in the adaptation field immediately following this byte
Discontinuity indicator10x80Set if current TS packet is in a discontinuity state with respect to either the continuity counter or the program clock reference
Random access indicator10x40Set when the stream may be decoded without errors from this point
Elementary stream priority indicator10x20Set when this stream should be considered "high priority"
PCR flag10x10Set when PCR field is present
OPCR flag10x08Set when OPCR field is present
Splicing point flag10x04Set when splice countdown field is present
Transport private data flag10x02Set when transport private data is present
Adaptation field extension flag10x01Set when adaptation extension data is present
Optional fields
PCR48Program clock reference, stored as 33 bits base, 6 bits reserved, 9 bits extension.
The value is calculated as base * 300 + extension.
OPCR48Original Program clock reference. Helps when one TS is copied into another
Splice countdown8Indicates how many TS packets from this one a splicing point occurs (Two's complement signed; may be negative)
Transport private data length8The length of the following field
Transport private datavariablePrivate data
Adaptation extensionvariableSee below
Stuffing bytesvariableAlways 0xFF
Adaptation extension format
NameNumber of bitsBitmaskDescription
Adaptation extension length80xff00The length of the header
Legal time window (LTW) flag10x0080
Piecewise rate flag10x0040
Seamless splice flag10x0020
Reserved50x001f
Optional fields
LTW flag set (2 bytes)
LTW valid flag10x8000
LTW offset150x7fffExtra information for rebroadcasters to determine the state of buffers when packets may be missing.
Piecewise flag set (3 bytes)
Reserved20xc00000
Piecewise rate220x3fffffThe rate of the stream, measured in 188-byte packets, to define the end-time of the LTW.
Seamless splice flag set (5 bytes)
Splice type40xf000000000Indicates the parameters of the H.262 splice.
DTS next access unit360x0efffefffeThe PES DTS of the splice point. Split up as multiple fields, 1 marker bit (0x1), 15 bits, 1 marker bit, 15 bits, and 1 marker bit, for 33 data bits total.
Payload format
NameNumber of bitsBitmaskDescription
Payload Pointer (optional)80xffPresent only if the Payload Unit Start Indicator (PUSI) flag is set, and the packet data type is PSI (not PES).

It gives the index after this byte at which the new payload unit starts. Any payload byte before the index is part of the previous payload unit.

Actual PayloadvariableThe content of the payload.

Packet identifier (PID)

Each table or elementary stream in a transport stream is identified by a 13-bit packet identifier (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.

Packet identifiers in use
DecimalHexadecimalDescription
00x0000Program association table (PAT) contains a directory listing of all program map tables
10x0001 Conditional access table (CAT) contains a directory listing of all ITU-T Rec. H.222 entitlement management message streams used by program map tables
20x0002Transport stream description table (TSDT) contains descriptors relating to the overall transport stream
30x0003IPMP control information table contains a directory listing of all ISO/IEC 14496-13 control streams used by program map tables
4–150x0004-0x000FReserved for future use
16–310x0010-0x001FUsed by DVB metadata [14]
  • 0x0010: NIT, ST
  • 0x0011: SDT, BAT, ST
  • 0x0012: EIT, ST, CIT
  • 0x0013: RST, ST
  • 0x0014: TDT, TOT, ST
  • 0x0015: network synchronization
  • 0x0016: RNT
  • 0x0017-0x001B: reserved for future use
  • 0x001C: inband signalling
  • 0x001D: measurement
  • 0x001E: DIT
  • 0x001F: SIT
32-81860x0020-0x1FFAMay be assigned as needed to program map tables, elementary streams and other data tables
81870x1FFBUsed by DigiCipher 2/ATSC MGT metadata
8188–81900x1FFC-0x1FFEMay be assigned as needed to program map tables, elementary streams and other data tables
81910x1FFFNull Packet (used for fixed bandwidth padding)

Programs

Transport stream has a concept of programs. Every program is described by a program map table (PMT). The elementary streams associated with that program have PIDs listed in the PMT. Another PID is associated with the PMT itself. 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 one of the three channels 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 a multi-program transport stream (MPTS). A single program transport stream is referred to as a single-program transport stream (SPTS).

Program specific information

There are 4 program specific information (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.

PCR

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 (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 PMT. The value of the PCR, when properly used, is employed to generate a system_timing_clock in the decoder. The system time clock (STC) decoder, when properly implemented, provides a highly accurate time base that is used to synchronize audio and video elementary streams. Timing in MPEG-2 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 bits are based on a 27 MHz clock. The maximum jitter permitted for the PCR is +/- 500 ns.

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 null packets have a payload that is filled with 0xFF, and the receiver is expected to ignore its contents. [15]

Use in digital video cameras

Transport Stream was originally designed for broadcast. Later it was adapted for use with digital video cameras, recorders and players by adding a 4-byte timecode (TC) field to the standard 188-byte packets, resulting in a 192-byte packet. [16] [17] This is what is informally called M2TS stream, commonly found in HDV cameras. The Blu-ray Disc Association calls it "BDAV MPEG-2 transport stream". [16] JVC called it TOD [lower-alpha 3] when used in HDD-based camcorders like GZ-HD7. [18] [19] The timecode allows quick access to any part of the stream either from a media player, or from a non-linear video editing system. [20] It is also used to synchronize video streams from several cameras in a multiple-camera setup.

Use in Blu-ray

Blu-ray Disc video titles authored with menu support are in the Blu-ray Disc Movie (BDMV) format and contain audio, video, and other streams in a BDAV container, which is based on the MPEG-2 transport stream format. [21] [22] Blu-ray Disc video uses these modified MPEG-2 transport streams, compared to DVD's program streams that don't have the extra transport overhead.

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 Blu-ray Disc recordable for audio/video recording. [22] [lower-alpha 4] Blu-ray Disc employs the MPEG-2 transport stream recording method. This enables transport streams of a BDAV converted digital broadcast to be recorded as they are with minimal alteration of the packets. [17] It also enables simple stream cut style editing of a BDAV converted digital broadcast that is recorded as is and where the data can be edited just by discarding unwanted packets from the stream. Although it is quite natural, a function for high-speed and easy-to-use retrieval is built in. [17] [24]

See also

Notes

  1. The Blu-ray format does not require CBR.
  2. Forward error correction is added by ISDB & DVB (16 bytes) and ATSC (20 bytes), [7] while the M2TS format prefixes packets with a 4-byte copyright and timestamp tag.
  3. Possibly an abbreviation for "Transport stream on disc".
  4. Filename extension .m2ts is used on Blu-ray Disc video files which contain an incompatible BDAV MPEG-2 transport stream due to the four additional octets added to every packet. [16] [23]

Related Research Articles

A codec is a device or computer program that encodes or decodes a data stream or signal. Codec is a portmanteau of coder/decoder.

<span class="mw-page-title-main">MPEG-2</span> Video encoding standard

MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information". It describes a combination of lossy video compression and lossy audio data compression methods, which permit storage and transmission of movies using currently available storage media and transmission bandwidth. While MPEG-2 is not as efficient as newer standards such as H.264/AVC and H.265/HEVC, backwards compatibility with existing hardware and software means it is still widely used, for example in over-the-air digital television broadcasting and in the DVD-Video standard.

In telecommunications and computer networking, a network packet is a formatted unit of data carried by a packet-switched network. A packet consists of control information and user data; the latter is also known as the payload. Control information provides data for delivering the payload. Typically, control information is found in packet headers and trailers.

DVB-T, short for Digital Video Broadcasting – Terrestrial, is the DVB European-based consortium standard for the broadcast transmission of digital terrestrial television that was first published in 1997 and first broadcast in Singapore in February, 1998. This system transmits compressed digital audio, digital video and other data in an MPEG transport stream, using coded orthogonal frequency-division multiplexing modulation. It is also the format widely used worldwide for Electronic News Gathering for transmission of video and audio from a mobile newsgathering vehicle to a central receive point. It is also used in the US by Amateur television operators.

Digital Video Broadcasting - Cable (DVB-C) is the DVB European consortium standard for the broadcast transmission of digital television over cable. This system transmits an MPEG-2 or MPEG-4 family digital audio/digital video stream, using a QAM modulation with channel coding. The standard was first published by the ETSI in 1994, and subsequently became the most widely used transmission system for digital cable television in Europe, Asia and South America. It is deployed worldwide in systems ranging from the larger cable television networks (CATV) down to smaller satellite master antenna TV (SMATV) systems.

<span class="mw-page-title-main">ATSC standards</span> Standards for digital television in the US

Advanced Television Systems Committee (ATSC) standards are an International set of standards for broadcast and digital television transmission over terrestrial, cable and satellite networks. It is largely a replacement for the analog NTSC standard and, like that standard, is used mostly in the United States, Mexico, Canada, South Korea and Trinidad & Tobago. Several former NTSC users, such as Japan, have not used ATSC during their digital television transition, because they adopted other systems such as ISDB developed by Japan, and DVB developed in Europe, for example.

CTA-708 is the standard for closed captioning for ATSC digital television (DTV) streams in the United States and Canada. It was developed by the Consumer Electronics sector of the Electronic Industries Alliance, which later became the standalone organization Consumer Technology Association.

<span class="mw-page-title-main">1080p</span> Video mode

1080p is a set of HDTV high-definition video modes characterized by 1,920 pixels displayed across the screen horizontally and 1,080 pixels down the screen vertically; the p stands for progressive scan, i.e. non-interlaced. The term usually assumes a widescreen aspect ratio of 16:9, implying a resolution of 2.1 megapixels. It is often marketed as Full HD or FHD, to contrast 1080p with 720p resolution screens. Although 1080p is sometimes referred to as 2K resolution, other sources differentiate between 1080p and (true) 2K resolution.

A container format or metafile is a file format that allows multiple data streams to be embedded into a single file, usually along with metadata for identifying and further detailing those streams. Notable examples of container formats include archive files and formats used for multimedia playback. Among the earliest cross-platform container formats were Distinguished Encoding Rules and the 1985 Interchange File Format.

These tables compare features of multimedia container formats, most often used for storing or streaming digital video or digital audio content. To see which multimedia players support which container format, look at comparison of media players.

Dolby Digital Plus, also known as Enhanced AC-3, is a digital audio compression scheme developed by Dolby Labs for the transport and storage of multi-channel digital audio. It is a successor to Dolby Digital (AC-3), and has a number of improvements over that codec, including support for a wider range of data rates, an increased channel count, and multi-program support, as well as additional tools (algorithms) for representing compressed data and counteracting artifacts. Whereas Dolby Digital (AC-3) supports up to five full-bandwidth audio channels at a maximum bitrate of 640 kbit/s, E-AC-3 supports up to 15 full-bandwidth audio channels at a maximum bitrate of 6.144 Mbit/s.

Program-specific information (PSI) is metadata about a program (channel) and part of an MPEG transport stream.

<span class="mw-page-title-main">Asynchronous serial interface</span> Standardised transport interface for the broadcast industry

Asynchronous Serial Interface, or ASI, is a method of carrying an MPEG Transport Stream (MPEG-TS) over 75-ohm copper coaxial cable or optical fiber. It is popular in the television industry as a means of transporting broadcast programs from the studio to the final transmission equipment before it reaches viewers sitting at home.

Packetized Elementary Stream (PES) is a specification in the MPEG-2 Part 1 (Systems) and ITU-T H.222.0 that defines carrying of elementary streams in packets within MPEG program streams and MPEG transport streams. The elementary stream is packetized by encapsulating sequential data bytes from the elementary stream inside PES packet headers.

Program stream is a container format for multiplexing digital audio, video and more. The PS format is specified in MPEG-1 Part 1 and MPEG-2 Part 1, Systems. The MPEG-2 Program Stream is analogous and similar to ISO/IEC 11172 Systems layer and it is forward compatible.

ATSC-M/H is a U.S. standard for mobile digital TV that allows TV broadcasts to be received by mobile devices.

The presentation timestamp (PTS) is a timestamp metadata field in an MPEG transport stream or MPEG program stream that is used to achieve synchronization of programs' separate elementary streams (for example Video, Audio, Subtitles) when presented to the viewer. The PTS is given in units related to a program's overall clock reference, either Program Clock Reference (PCR) or System Clock Reference (SCR), which is also transmitted in the transport stream or program stream.

.m2ts is a filename extension used for the Blu-ray disc Audio-Video (BDAV) MPEG-2 Transport Stream (M2TS) container file format. It is used for multiplexing audio, video and other streams, such as subtitles. It is based on the MPEG-2 transport stream container. This container format is commonly used for high definition video on Blu-ray Disc and AVCHD.

AVCREC is a format for recording and playback of high definition video in BDAV format using conventional DVD recordable discs as recording media. Presently, AVCREC is tightly integrated with ISDB broadcast standard and is not marketed outside Japan.

MPEG media transport (MMT), specified as ISO/IEC 23008-1, is a digital container standard developed by Moving Picture Experts Group (MPEG) that supports High Efficiency Video Coding (HEVC) video. MMT was designed to transfer data using the all-Internet Protocol (All-IP) network.

References

  1. "TVNT.net - Le forum de la TNT • [Topic Unique] Akira DHB-B31HDR - Double tuner enregistreur TNT HD - MKV - DIVX - DTS : Les adaptateurs pour recevoir la TNT gratuite en SD ou HD". www.tvnt.net.
  2. MIME Type Registration of RTP Payload Formats. July 2003. doi: 10.17487/RFC3555 . RFC 3555.
  3. "mpeg2TransportStream". Apple Developer Documentation. Apple Inc.
  4. 1 2 3 ITU-T (October 2014). "Recommendation H.222.0 (10/14)".
  5. MPEG-2 Encoding Family (Full draft). Sustainability of Digital Formats. Washington, D.C.: Library of Congress. 14 February 2012. Retrieved 13 December 2021. Licenses pertain to tools and not to streams or files per se.
  6. "MPEG-2 Transport Stream". AfterDawn.com. Retrieved 8 June 2010.
  7. "ATSC transmission". Broadcastengineering.com. 20 June 2005. Retrieved 17 May 2012.
  8. "MPEG Systems FAQ". Mpeg.chiariglione.org. Retrieved 17 May 2012.
  9. "ATSC MPEG Transport Stream Monitor". Tek.com. Retrieved 17 May 2012.
  10. "TSReader". Coolstf.com. 7 April 2008. Archived from the original on 27 March 2010. Retrieved 17 May 2012.
  11. "Information technology – Generic coding of moving pictures and associated audio information: systems". February 2000.
  12. "Standards – DVB" (PDF). Dvb.org. Archived from the original (PDF) on 13 March 2011. Retrieved 11 September 2012.
  13. Fairhurst, Gorry. "MPEG-2 Transmission". Archived from the original on 13 August 2017. Retrieved 30 November 2018.
  14. "5.1.3 Coding of PID and table_id fields". Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems (PDF). EN. Vol. 300 468 (v1.13.1 ed.). 2012. p. 20. Retrieved 13 October 2016.{{cite book}}: |website= ignored (help)
  15. A Guide to MPEG Fundamentals and Protocol Analysis (PDF), Tektronix, p. 37, retrieved 23 April 2020
  16. 1 2 3 BD ROM – Audio Visual Application Format Specifications (PDF), Blu-ray Disc Association, March 2005, pp. 15–16, archived from the original (PDF) on 3 November 2020, retrieved 26 July 2009
  17. 1 2 3 BD-RE – Audiovisual Application Format Specification for BD-RE 2.1 (PDF), Blu-ray Disc Association, March 2008, archived from the original (PDF) on 6 February 2009
  18. "Steve Mullen, M2TS primer". Dvinfo.net.
  19. "Working with JVC Everio MOD & TOD files". Archived from the original on 23 October 2008.
  20. "How MPEG-TS works". Forum.videohelp.com. Retrieved 17 May 2012.[ self-published source? ]
  21. Afterdawn.com Glossary – BD-MV (Blu-ray Movie) and BDAV container Archived 18 February 2009 at the Wayback Machine , Retrieved on 26 July 2009
  22. 1 2 Afterdawn.com Glossary – BDAV container, Retrieved on 26 July 2009
  23. Videohelp.com What is Blu-ray Disc and HD DVD? Archived 24 December 2009 at the Wayback Machine , Retrieved on 26 July 2009
  24. Blu-ray Disc Association (August 2004) Blu-ray Disc Format, White paper (PDF) Page 22, Retrieved on 28 July 2009