August 5, 2016

MPEG2-TS Encapsulation Overheads in HLS

by Prashanth Dixit (Principal Engineer, Media Server Technologies)

The MPEG-2 Transport Stream (MPEG2-TS, M2TS orTS) is a standard container format specified in MPEG-2 Part 1, Systems (ISO/IEC standard 13818-1).MPEG2-TS encapsulates digital audio and video, offering error correction and synchronization features. Introduced in 1995, it has been extensively used for transmission and storage in broadcast systems such as DVBATSC and IPTV.

Recent years have seen the rapid adoption and rise of Adaptive Bitrate (ABR) streaming over HTTP, as employed in Over the Top (OTT), Video on Demand (VoD), Pay TV and other internet based media delivery services. MPEG2-TS continues to play an important role in ABR streaming through its adoption as the encapsulation format for segments in ABR streaming standards such as Apple HTTP Live Streaming (HLS).

Along with the adoption of ABR streaming, there has been a significant focus on video compression efficiencies to provide users with a better experience over constrained and varying network conditions. Many streaming services have adopted advanced video compression standards such as H.265/HEVC and VP9, often at significant costs due to increased computational complexity and costs associated with deployment of a new codec.

At the same time, HLS packaging overheads can constitute up to 15% of the total bandwidth, especially for lower bit rate video representations. These overheads have often been overlooked in efforts to reduce bandwidth. Most of the packaging overhead comes from the following elements of MPEG2-TS, used to encapsulate ABR segments:

  • PES Headers
    Compressed video and audio Elementary Streams (ES) of one or more frames are packetized to produce Packetized Elementary Streams (PES) packets before being encapsulated in a Transport Stream (TS). Each PES packet contains a PES Header of 14-19 bytes.
  • TS Headers and Stuffing
    In order to provide better error concealment, MPEG2-TS restricts TS packet size to a fixed 188 bytes. Each TS packet begins with a 4 byte Header and zero or more stuffing bytes to maintain the fixed 188 byte length.
    PAT/PMT/SDT and other PSI/SI tables
    Program Specific Information (PSI)/Service Information (SI) tables consist of normative data which are necessary for de-multiplexing of transport streams and successful regeneration of programs.
  • PCR and Timing information
    Another important constituent of MPEG2-TS is the timing information required to synchronize servers and clients. This includes information such as Program Clock Reference (PCR), Presentation Time Stamp (PTS) and Decoding Time Stamp (DTS).

The structure of the PES headers and TS headers are illustrated in the diagram below.

Blog-MC-TSOverhead-Diagram

Each of these elements are required to transmit essential information and cannot be eliminated altogether. Optimizing the overheads requires a comprehensive understanding of the MPEG2-TS standard, deployed players, networks and service parameters.

Advanced packager and segmenter implementations in Ittiam’s Media Engine and Media Cloud Software reduce HLS overheads from up to 15% to under 5%. The gains are highest for lower bit rate ABR profiles that are deployed in highly constrained network environments and most sensitive to bandwidth efficiency. With no addition to processing complexity and no changes to deployed infrastructure,the gains from MPEG2-TS overhead reduction directly translate to reduced storage and network costs while improving the end user experience.

For more information, reach out to us @ mkt@www.ittiam.com