Triveni Digital Inc. MPEG Technology Series. MPEG 101 (MPEG 2 with a dash of MPEG 4 thrown in) Copyright 2011 Triveni Digital, Inc.

Similar documents
TransMu x. Users Manual. Version 3. Copyright PixelTools Corporation

Module 10 MULTIMEDIA SYNCHRONIZATION

MPEG TS. MAYAH Communications Application Note 34. MAYAH Communications GmbH Application Note 34 MPEG TS

MPEG-2 Transport Stream

Multi-Source Analyzer (MSA) Series

MISB ST STANDARD. MPEG-2 Transport Stream for Class 1/Class 2 Motion Imagery, Audio and Metadata. 27 October Scope.

MISB ST STANDARD. MPEG-2 Transport Stream for Class 1/Class 2 Motion Imagery, Audio and Metadata. 25 February Scope.

Digital Television DVB-C

Model: LT-122-PCIE For PCI Express

[1] ISO/IEC :2007 Information technology - Generic coding of moving pictures and associated audio information: Systems

Opportunities for Data Broadcasting in Digital TV

AMERICAN NATIONAL STANDARD

Request for Comments: 4425 Category: Standards Track February 2006

VIDEO COMPRESSION STANDARDS

ECE 417 Guest Lecture Video Compression in MPEG-1/2/4. Min-Hsuan Tsai Apr 02, 2013

Assuring Media Quality in IP Video Networks. Jim Welch IneoQuest Technologies

ANSI/SCTE

About MPEG Compression. More About Long-GOP Video

IP Video Network Gateway Solutions

IPTV 1

Audio and video compression

Annex (informative) to A001 Rev. 6: Guidelines for the Implementation of DTS Coded Audio in DVB Compliant Transport Streams

User manual. 64-Channel Real-Time TS Analyzer. web-based user interface. for the built-in. 64-Channel Real-Time TS Analyzer Web Interface CW-4957

Computer and Machine Vision

INFORMATION TECHNOLOGY - GENERIC CODING OF MOVING PICTURES AND ASSOCIATED AUDIO: SYSTEMS Recommendation H.222.0

MISB ST STANDARD. Timestamps for Class 1/Class 2 Motion Imagery. 25 February Scope. 2 References

ELEC 691X/498X Broadcast Signal Transmission Winter 2018

International Journal of Emerging Technology and Advanced Engineering Website: (ISSN , Volume 2, Issue 4, April 2012)

MULTIPLEXING/DE-MULTIPLEXING DIRAC VIDEO WITH AAC AUDIO BIT STREAM ASHWINI URS. Presented to the Faculty of the Graduate School of

Messenger 2 Transmitter Camera-Mount (M2T-C)

Contents. Introduction. Configure (Best Practices)

MPEG-l.MPEG-2, MPEG-4

MISB EG Motion Imagery Standards Board Engineering Guideline. 24 April Delivery of Low Bandwidth Motion Imagery. 1 Scope.

Configure Video and Audio Settings

MPEG-2 Patent Portfolio License Illustrative Cross-Reference Chart Ctry. Patent No. Claims Category Description Standard Sections

15: OS Scheduling and Buffering

DRAFT. Encapsulation of Dirac Video content and time code markers in ISO/IEC Transport Streams

DVBControl Intuitive tools that enables you to Control DVB!

Transport protocols Introduction

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

WatchiTV Portable: IPTV Expert Analysis Application

RECOMMENDATION ITU-R BT.1720 *

MPEG-4: Overview. Multimedia Naresuan University

TS Manipulator Requirement Specifications & High Level Design Document. George Mason University

CODING METHOD FOR EMBEDDING AUDIO IN VIDEO STREAM. Harri Sorokin, Jari Koivusaari, Moncef Gabbouj, and Jarmo Takala

INTERNATIONAL TELECOMMUNICATION UNION

Digital Imaging and Communications in Medicine (DICOM) Supplement 180: MPEG-4 AVC/H.264 Transfer Syntax

ENGINEERING COMMITTEE Data Standards Subcommittee SCTE STANDARD SCTE Modular Headend Architecture Part 6: Edge QAM Video Stream Interface

1. Hardware Setup Basic D2Manage Setup...4

WEBINAR on the DVB Single Illumination System

How to achieve low latency audio/video streaming over IP network?

Annotation Universal Metadata Set. 1 Scope. 2 References. 3 Introduction. Motion Imagery Standards Board Recommended Practice MISB RP 0602.

Testing Video over IP Product and Services

SMPTE ST 2022: Moving Serial Interfaces (ASI & SDI) to IP. Thomas Edwards VP Engineering & Development FOX Networks Engineering & Operations

Network Operations Subcommittee AMERICAN NATIONAL STANDARD

Video Compression An Introduction

SamKnows test methodology

UBR Congestion controlled Video Transmission over ATM Eltayeb Omer Eltayeb, Saudi Telecom Company

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

Introduction to LAN/WAN. Application Layer 4

DVBControl. DVBAnalyzer DVBMosaic DVBLoudness DVBMonitor. Catalogue 2011/2012. Intuitive tools that enables you to Control DVB!

Week 14. Video Compression. Ref: Fundamentals of Multimedia

MPEG-4. Today we'll talk about...

MISB RP RECOMMENDED PRACTICE. 24 October Annotation Universal Metadata Set. 1 Scope. 2 References. 2.1 Normative References

Error Control Techniques for Interactive Low-bit Rate Video Transmission over the Internet.

CS 218 F Nov 3 lecture: Streaming video/audio Adaptive encoding (eg, layered encoding) TCP friendliness. References:

RECOMMENDATION ITU-R BT Service multiplex, transport, and identification methods for digital terrestrial television broadcasting

Image and video processing

CSCD 433/533 Advanced Networks Fall Lecture 14 RTSP and Transport Protocols/ RTP

CARRIAGE OF MPEG-4 OVER MPEG-2 BASED SYSTEMS. Ardie Bahraini Motorola Broadband Communications Sector

PHYSICAL LAYER TIMING

Model: LT-101-USB. LT-101 For USB

User Manual. Multiplexer (Demo)

Measuring and Correcting Lip Sync Progress on a Standard At Last!

Request for Comments: 5109 December 2007 Obsoletes: 2733, 3009 Category: Standards Track. RTP Payload Format for Generic Forward Error Correction

EN-264 DVB MPEG-4 HDTV ENCODER & TRANSCODER - 0 MI1720 -

CS 457 Multimedia Applications. Fall 2014

A 120 fps High Frame Rate Real-time Video Encoder

Technical Specifications EN80/81/40 Encoder - RD60 IRD

ATSC Standard: A/342 Part 2, AC-4 System

Youngkwon Lim. Chair, MPEG Systems Samsung

Multimedia Decoder Using the Nios II Processor

MP2TSME v8.0 Release Notes

Mark Kogan CTO Video Delivery Technologies Bluebird TV

Module 7 VIDEO CODING AND MOTION ESTIMATION

Chapter 7. The Transport Layer

MA5400 IP Video Gateway. Introduction. Summary of Features

MPEG-2. ISO/IEC (or ITU-T H.262)

Lecture 3 Image and Video (MPEG) Coding

Creating and Configuring Outgoing Transport Streams

CSCD 443/533 Advanced Networks Fall 2017

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

MPEG2 -TS Multi-Program Channel Selector

Compression and File Formats

UC-450E+ MPEG-4 HD/SD Encoder. User Manual. Version:

A Perspective on Video and Image Compression in Cable Networks

Fixed bonding settings not being applied in Sputnik Direct mode.

MPEG Video Decoder (VdecMpeg) API 2

NOMAD - MEDIA PROFESSIONALS MOST VERSATILE COMPANION

ANSI/SCTE

Transcription:

Triveni Digital Inc. MPEG Technology Series MPEG 101 (MPEG 2 with a dash of MPEG 4 thrown in) An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

Course Sections Encoding Basics Transport Stream Elements Multiplexor Functions Metadata MPEG Timing Elements and Lip Sync considerations Decoder Buffering Functions Copyright 2011 Triveni Digital, Inc. An LG Electronics Company MPEG4 Overview

Part 1 MPEG2 Encoding Elements An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

MPEG-2 Video Encoding MPEG2/4 Video Compression Digital Compression starts at the MPEG encoder Either MPEG2 or MPEG4 CODECS (Coder Decoder Algorithm) can be carried in an MPEG2 Transport Stream The encoder filters noise in the input signal and compresses baseband video & audio or uncompressed digitized video/audio/data Video and Audio, and sometimes Data elements are encoded into a sequence of frames A frame is a single image from a video or audio sequence Each frame is encoded in one of three ways: An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 4

MPEG-2 Video Encoding I Frames I-picture: intra-picture encoding, similar to jpeg encoding (exploiting spatial redundancy). A digitized picture of everything in the camera frame Highest amount of data of all other frame types Group Of Pictures always start with an I frame or Anchor frame B & P frames are calculated or based off of the I frame I stands for Intra coded An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 5

MPEG-2 Video Encoding P Frames P-picture: predictive encoding, using motion adjusted deltas from a previous reference frame (exploiting temporal redundancy). Compressed using data referenced from closest preceding I or P frame. P frames encode the changes or differences in motion thus saving bitrate Part of the GOP (Group of Pictures) with back-to-back P frames usually indicate fast motion as the data rate is rapidly changing An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 6

MPEG-2 Video Encoding (Contd.) Example 1. Panning Camera I-picture B-picture I-picture Example 2. Moving Object I-picture P-picture I-picture An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 7

MPEG-2 Video Encoding B Frames B-picture: bi-directional encoding, using motion adjusted deltas from a previous and a future frame (exploiting temporal redundancy). Uses Data from preceding and following I & P frames Depends on data before and/or after in video sequence Cannot calculate from another B frame Further reduces bitrate requirements for encoding ALL professional encoders attempt to filter noise out of the input before the encoding process An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 8

MPEG-2 Video Encoding Group of Pictures = GOP Series of encoded frames consisting of a single I frame with P & B frames A GOP begins with an I frame and ends with last frame before the next I frame All frames within the GOP depend directly or indirectly on data from the I frame Relationships between GOPs: OPEN or CLOSED Closed GOP is self-contained. No dependence on data outside GOP Open GOP can use data from I frame of following GOP Variable GOP the amount of P and B frames can vary between I frames based on input Advanced system use GOP-less structures. P/B Frames only using portions of the I frames An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 9

MPEG-2 Video Encoding Typical GOP Structures B Frame 49.9 Kb I Frame 216.6 Kb P Frame 83.45 Kb I B B P B B P B B P B B I B B P B B P B B P B B Typical low motion GOP sequence P Frame 59.9 Kb I Frame 183.2 Kb P Frame 44.5 Kb I P P P P P P P P P P P I P P P P P P P P P P P Typical high motion GOP sequence An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 10

MPEG-2 Video Encoding (Contd.) Encoder emits sequence of encoded frames (Aud & Vid or Data) Sizes of encoded frames vary based upon compression Encoded frames are packed into packetized elementary stream (PES) packets PES packets are packed into MPEG-2 transport packets at the mux (All packets for single video or audio or data stream have same PID value) and output from the encoder Overall compression ratio at this layer is 50:1 or more Can be quite an efficient process and allows for multichannel services while conserving overall bandwidth! An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 11

AC-3 Audio Encoding Audio frames, each 32 milliseconds in length, are encoded. Encoded frame size depends only on bitrate. Encoded frames are packed into packetized elementary stream (PES) packets. PES packets are packed into MPEG-2 transport packets. (All packets for single audio stream have same PID value.) An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 12

MPEG2 Transport Stream Elements An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

MPEG Transport Basics MPEG Transport Stream Basics Packet header PSI Tables metadata PAT PMT Elementary streams Encoding Buffering Synchronization An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 14

MPEG2 Transport Stream Basics (cont.) A Special Use Case of MPEG-2 transport stream Other types of packet based systems use MPEG packets such as Cable Modems (DOCSIS) and Banking systems among others Digital Video and Audio require very discrete timing information to be present along with the and inside the MPEG2 packets MPEG expects a constant network delay factor for packet delivery and demands that there be no packet loss! These expectations and demands remain constant from ingest to last mile. We are now a Packet Factory Need to deeply inspect packets as travel along our production and delivery chains. Standards compliant streams generally survive the journey An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 15

MPEG2 Transport Stream Basics (cont.) May contain multiple virtual channels Video channels A video stream One or more audio streams Possibly one or more data streams Audio channels One or more audio streams Possibly one or more data streams Data-only channels, One or more data streams An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 16

MPEG2 Transport Stream Basics (cont.) Made up of 188-byte transport packets, each with 4 byte header & 184 byte payload Each packet contains any ONE kind of information audio, video, data, PSI, One Transport (MPEG) Packet An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 17

MPEG-2 Transport Stream (Contd.) We say transport packets have multiple interleaved elementary streams -- audio, video, data, PSI,... Packets belonging to the same elementary stream are identified by packet id (PID) in packet header (same color in our illustrations). MPEG-2 Transport Stream These three packets are the same color. They have the same PID and belong to the same Elementary stream. An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 18

MPEG-2 Transport Stream Header Fields Noteworthy fields: 1) Sync Byte Find packet boundary 2) PID Used to Identify Stream Type while multiplexing/ de-multiplexing the TS stream 3) Continuity Counter Identify packet loss 4) PCR stamp in adaptation field Clock sync MPEG-2 Transport Stream Header (4 Bytes) 188 Bytes Sync Byte PID Adaptation Continuity Adaptation Counter Field Field (Optional) PES 1x Or other Payload (Pat, PMT, PSIP, etc)... An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 19

MPEG Header Fields: Sync Byte When a decoder first tunes, all it sees are a stream of 0 s and 1 s The decoder must first identify the beginning of packets before it can interpret the stream The decoder uses the Sync Byte field to do this Decoder: Receiver or set top box 01010001111010010101101010001100011110010111000 MPEG Data Prior to Packet Sync An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 20

MPEG Header Fields: Sync Byte (Contd.) The Sync Byte of a packet is always 0x47 (Hexadecimal) or 01000111 (Binary) The decoder looks for strings of zeros and ones which match the pattern of the sync byte (see red below) 01010001111010010101101010001110011110010111 (0x47) (0x47) An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 21

MPEG Header Fields: Sync Byte (Contd.) Once the decoder finds a 0x47 in the stream, it looks 187 bytes down the stream, and looks for another 0x47 If it finds three Sync Bytes in a row, then the Decoder has Found Sync and assumes packet boundaries from then on Each packet is tested for 0x47 as soon as it arrives. If a packet arrives with an incorrect sync byte, the decoder starts over. This is called SYNC LOSS Found Sync 0x47 187 bytes 0x47 187 bytes 0x47 187 bytes Packet 188 bytes Sync Lost Packet 188 bytes Packet 188 bytes 0x32 11010101010111011010101010001 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 22

MPEG Header Fields: Sync Byte (Contd.) If you don t have Packet Sync, the decoder cannot find packet boundaries. You will not be able to decode at all Packet Sync problems typically occur in hardware at packet boundaries during format converters, edge devices, demodulators etc: ASI to SMPTE-310 ASI to Gig-E ASI to Microwave or QAM Satellite to ASI An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 23

MPEG2 Multiplexor Functions An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

PIDs Defined Example Digital Cable Bitstream MUX Video/Audio channel Video/Audio channel Video/Audio channel Audio Encoder Video Encoder Audio Encoder Video Encoder Audio Encoder Video Encoder PAT PMT Null CAT Video Audio Multiplexer Video Audio Video Audio Video Audio Video/Audio channel Audio Encoder Video Encoder MPEG-2 Transport Stream An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 25

Transport Stream Demultiplexing When a set top box first receives a Transport Stream, it demultiplexes that stream based on PID Decoder: Receiver or set top box Program 01 Video Program 02 Video Program 03 Video PAT/PMT/ MPEG Tables PSIP Tables Program 01 Audio Program 02 Audio Program 03 Audio An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 26

MPEG Header: Continuity Counter & CC Errors The continuity counter is a 4 bit field in the header which increments by 1 each time a packet comes out on a specific PID: All Packets PID 0x52 0 1 2 3 4 5 6 7 8 14 15 0 1 When a PID skips one value of the continuity Counter, we call it a Continuity Error. This means one or more packets were lost. All Packets PID 0x54 0 1 2 3 7 8 9 10 11 Continuity Error Here An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 27

MPEG Header: Continuity Counter (Contd.) Identifies WHEN we lose Packets, but not HOW MANY! Packet loss causes many other kinds of analysis to reset or give bogus results for other TS area measurements. Any analysis based on an average over many packets will automatically reset when it encounters continuity problems. Since a continuity error mean some packets have been lost, frequent continuity errors should be one of the FIRST things you look for when conducting MPEG analysis. An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 28

Key Items to Remember Main monitoring and troubleshooting lessons: Fix Continuity Problems first Continuity errors create bogus alarms in other areas Until you resolve the continuity problems, it will be very hard to determine if you have other problems in your stream To Be Discussed To Be Discussed An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 29

MPEG2 Metadata Functions An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

Metadata Data about included data is metadata and orchestrates the decode process Metadata tells the decoder which kinds of information are contained in each PID, and which PID s go together in a program. Slow Metadata arrival times can slow program tuning times at the decoder There are three kinds of Metadata Program Specific Information (PSI) - Tables in the stream defined in the MPEG standards ISO 13818-1 Program and System Information Protocol (PSIP) -Tables defined in ATSC A/65 for broadcasters DVB SI Digital Video Broadcasting Service Information International standard An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 31

PSI Tables (MPEG-2 Tables) PAT Appears in PID 0x0000 - Program Association Table Identifies MPEG-2 programs in transport stream and gives PIDs for their PMTs The PAT is on PID 0x00. This is the first PID or Base PID a MPEG decoder looks for PMT - Program Map Table Identifies elementary streams in programs (virtual channel), and gives their PID values. An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 32

MPEG-2 Program Specific Information (PSI) Gives very basic tuning information: PAT (Program Association Table: one for entire transport stream; identifies programs (virtual channels) in stream and gives PIDs for PMTs. Carried on a PID in the TS PMT (Program Map Table): one per program ; identifies elementary streams in program and gives their types (audio, video, etc.) and PIDs. Carried on a PID in the TS Supports tuning by physical channel number and MPEG-2 program number. PSI Table Intervals in the Transport stream PAT should be present at every 100ms PMT should be present at every 400ms An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 33

MPEG-2 PSI Tables (Contd.) PMT 1 Video PID 0x31 Audio PID 0x34 Audio PID 0x35 PCR_PID 0x31 PAT (always on PID 0x0) Station TSID PMT 1 -> On PID 0x30 PMT 2 -> On PID 0x40 PMT 3 -> On PID 0x50 PID 0x40 PMT 2 Video PID 0x41 Audio PID 0x44 Audio PID 0x45 PCR_PID 0x41 PMT 3 Video PID 0x51 Audio PID 0x54 Audio PID 0x55 PCR_PID 0x51 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 34

MT-40 Graphical View of PAT/PMT Elementary streams found in this PMT Descriptor Defines Additional Stream Characteristics Elementary streams found in this PMT Program 2 PID for PMT (PID 0x0000) Program 3 PID for PMT An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 35

Metadata Table and PCR Timing Arrival Times MPEG Metadata tables An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 36

MPEG2 Clock Timing Elements An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

Audio-Video Synchronization Audio, video are encoded independently at the encoder and must remain synchronized during the rendering process at the decoder MPEG has to allow for distances and signal processing between the Encoder and Decoder, and still allow for correct decode of the transport stream Lip Sync Issues can begin to occur when timing issues in the TS occur! An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 38

How to Assure Audio/Video Sync? In order for the audio and video Elementary Streams to remain in Sync, the Encoder Clock and the Decoder Clock must remain in sync The next few slides will discuss and demonstrate how this happens and what components to check when it fails An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 39

Encoder Inserts PCR When the encoder creates a stream of packets, it embeds the current value of it s 27 MHz clock into the stream This time reference is called the PCR: Program Clock Reference MPEG demands that one PCR packet appear in the stream every 100ms Encoder 27Mhz Clock MPEG Packets MPEG Packet with PCR Stamp An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 40

Decoder Consumes PCR When the decoder gets a packet containing a PCR timestamp, it adjusts it s 27Mhz clock accordingly MPEG Packets Decoder 27Mhz Clock Adjusts value of counter based on incoming PCR Packet An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 41

PCR Timestamp Issue What could conceptually cause PCR timestamp issues? Encoder possibly time stamped incorrectly Decoder possibly failed to consume time stamps PCR packet was accidentally lost in transmission When PCR time stamps go awry, we have PCR jitter An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 42

PCR Jitter Defined PCR Jitter is: Difference between the Actual Value of the PCR time stamped by encoder and the Expected Value of the PCR as calculated by decoder based on the clock rate and the time at which the PCR value is received. PCR Jitter spec: +/-500ns An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 43

PCR Rate (Frequency) Offset PCR Frequency Offset is: Difference between the clock frequency calculated at decoder based on actual PCR values received and an ideal 27 MHz clock, which is the clock rate dictated by the MPEG-2 standard PCR Frequency Offset Spec: +/- 810 Hz An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 44

PCR Intervals, Jitter and Rate PCR spec summary: Transmit interval: 100 ms Jitter: no more than +/-500 ns Rate: 27 MHz +/- 810 Hz Most streams seen in the field are compliant, but every now and then extreme jitter shows up. Here s Why An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 45

PCR Timestamp Issue (Contd.) What in your network facility could cause PCR timestamp issues? Three of the most common are: It can happen any time you MUX streams It can happen at the source encoding It can happen on any IP link due to network lag An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 46

PCR Packet Spacing Before Muxing Note the Number of Packets between each PCR packet in each Input Stream Video 0x31 Video 0x41 Video 0x51 PID 0x31 0x41 0x51 Packet Spacing 2 Packets 1 Packet 0 Packets Transport Stream MUX An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 47

PCR Packet Spacing After Muxing Note that the PCR packet spacing has changed! Video 0x31 Video 0x41 Video 0x51 Transport Stream MUX PID Old Spacing New Spacing 0x31 2 Packets 8 Packets 0x41 1 Packet 5 Packets 0x51 0 Packets 2 Packets An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 48

Muxing Causes PCR Jitter When we MUX multiple streams together, the spacing between the PCR packets in each stream CHANGES The physical shift results in a TEMPORAL shift as well, throwing the time stamps off The TEMPORAL shift in PCR values is referred to as PCR jitter An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 49

Muxing Causes PCR Jitter (Contd.) The MUX has to RESTAMP all the PCR values to correct for the change in the packet spacing to keep from jittering the stream THIS IS VERY HARD TO DO The more services on the output, the harder it is to restamp The fewer null packets at the output, the harder it is to restamp A NULL packet is an MPEG 2 packet containing NO data in its payload. Typically used as fill data to a achieve a specific overall data rate in the TS An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 50

PCR Timestamp Issue (Contd.) What in your network facility could cause PCR timestamp issues? Three of the most common are: It can happen any time you MUX streams It can happen at the source encoding It can happen on any IP link due to network delay or packet loss An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 51

PCR Jitter From Incorrect Encoding If the MPEG encoder s parameters are set up incorrectly, you can introduce jitter at the source This is relatively rare, however If a national programmer sent it s stream up to the bird with jitter in it, the result would effect all receive sites! Re-encoded streams at the headend may also add to PCR jitter Local broadcast streams could contain PCR jitter in transmission An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 52

PCR Timestamp Issue (Contd.) What in your network facility could cause PCR timestamp issues? Three of the most common are: It can happen any time you MUX streams It can happen at the source encoding It can happen on any MPEG over IP link due to network delay or packet loss on the IP layer An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 53

The Encoder and Decoder Clock The MPEG encoder and MPEG decoder use a 27Mhz clock to encode/decode incoming audio and video The clock is actually a counter which advances every 1/27000000 seconds Encoder 27Mhz Clock Decoder 27Mhz Clock 1,2,3,4.. 1,2,3,4.. An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

The Encoder and Decoder Clock The MPEG encoder and MPEG decoder use a 27Mhz clock to encode/decode incoming audio and video The clock is actually a counter which advances every 1/27000000 seconds Encoder 27Mhz Clock Decoder 27Mhz Clock 1,2,3,4.. 1,2,3,4.. An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 55

The Encoder and Decoder Clock The MPEG encoder and MPEG decoder use a 27Mhz clock to encode/decode incoming audio and video The clock is actually a counter which advances every 1/27000000 seconds Encoder 27Mhz Clock 1,2,3,4.. Massive Network Processing Decoder 27Mhz Clock 1,2,3,4.. An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 56

MPEG2 Decoder Buffering Functions An LG Electronics Company Copyright 2011 Triveni Digital, Inc.

MPEG-2 Elementary Stream PTS DTS Only PTS on Audio PES packet PES Header PES Packet Payload PES Header PES Packet Payload PES Header PES Packet Payload MPEG-2 Elementary Stream Header (4 Bytes) 188 Bytes Sync Byte PID Adaptation Continuity Adaptation Field Counter Field (Optional) PES 1x Or other Payload (Pat, PMT, PSIP, etc)... Adaptation Field on Video PID s Only Length Flags Optional Fields Stuffing Bytes PCR An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 58

Presentation Time Stamp - PTS Each Frame is marked with a PTS Presentation Time Stamp a positive number The value of the PTS is set to the value of the Encoder Clock when the frame is encoded Encoder 27Mhz Clock MPEG Packets 1,2,3,4.. F1 PTS 500 F2 PTS 950 Packetizer An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 59

Packets Assigned to Decode Buffer As packets flow into the Decoder, a space in memory is set aside for them, one buffer for each PID. MPEG Packets Decoder 27Mhz Clock 1,2,3,4.. Buffer 1 Pid 0x31 Video Buffer 2 Pid 0x34 Audio An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 60

Reconstruction of Frames From Buffer Packets form Video and Audio Frames in the buffer MPEG Packets Decoder 27Mhz Clock 1,2,3,4.. Buffer 1 Pid 0x31 Video F1 PTS 500 F2 PTS 675 F3 PTS 950 Buffer 2 Pid 0x34 Audio F1 PTS 200 F2 PTS 990 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 61

The Magic of Decode When the value of the Decode clock MATCHES the PTS on the frame, that frame is sent to the decode hardware MPEG Packets Decoder 27Mhz Clock = 200 Decode Hardware F1 PTS 200 Buffer 1 Pid 0x31 Video F1 PTS 500 F2 PTS 675 F3 PTS 950 Buffer 2 Pid 0x34 Audio F2 PTS 990 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 62

Another Frame Goes to Decode Hardware Next Frame MPEG Packets Decoder 27Mhz Clock = 500 Decode Hardware F1 PTS 500 Buffer 1 Pid 0x31 Video F2 PTS 675 F3 PTS 950 Buffer 2 Pid 0x34 Audio F2 PTS 990 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 63

One More Frame Heads to Decode And the next frame MPEG Packets Decoder 27Mhz Clock = 675 Decode Hardware F2 PTS 675 Buffer 1 Pid 0x31 Video F3 PTS 950 Buffer 2 Pid 0x34 Audio F2 PTS 990 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 64

Audio and Video Buffers Receiver must buffer audio and video frame data until presentation time. If data appears too late in the transport stream, buffer underflow results. If data appears too early in the transport stream, buffer overflow results. Either condition results in garbled play or incorrect synchronization. Different decoders/receivers may respond differently to the same underlying buffer violations An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 65

Summary: Audio/Video Sync PCR values help the Encoder Clock and the Decoder Clock to remain in sync PCR jitter can cause synchronization problems for elementary streams Ensure PCR jitter and frequency offsets are within standard limits Elementary stream buffers limits are NOT violated Large PCR jitter values can cause Lip sync error Buffer over- or underflow problems may cause tiling, pixelization / macro blocking errors or Audio disturbances An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 66

Key Items to Remember Main monitoring and troubleshooting lessons: Fix Continuity Problems first Continuity errors create bogus alarms in other areas Until you resolve the continuity problems, it will be very hard to determine if you have other problems in your stream Check for PCR jitter PCR jitter can cause packet over- or underflow problems Lip synch errors may also be result of PCR jitter Check to ensure Video and Audio Buffer are not in standards violation An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 67

Summary: MPEG s 7 Basic Parameters Standards Compliance: PAT Interval: 100ms PMT Interval: 400ms PCR Interval: 100ms Also check: Max Jitter: +/-500ns Max Freq. Offset: +/- 810 Hz Video Buffer Compliance Audio Buffer Compliance An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 68

A bit about H.264/AVC/MPEG-4 ITU-T H.264 standard and the ISO/IEC MPEG-4 AVC standard (formally, ISO/IEC 14496-10 - MPEG-4 Part 10, Advanced Video Coding) MPEG4 aka H.264 or AVC was Developed jointly by Video Coding Experts Group (VCEG) and the Moving Pictures Experts Group (MPEG) early 2000 s Jointly maintained so that they have identical technical content MPEG4 and MPEG2 are both collections of video, audio, and data compression coding techniques H.264/AVC/MPEG4 codecs were optimized for streaming technologies over IP networks. Early Example: Video Conferencing Maintains or exceeds MPEG2 video quality while reducing service bandwidth by a factor of two or more (40-60% bitrate savings) An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 69

MPEG-4 vs. MPEG2 Reduced Services Bitrates Increased quality Designed for IP packet based networks Reduced footprint Increased equipment costs Increased complexity An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 70

References Information Technology -- Generic Coding of Moving Pictures and Associated Audio Information: Systems (MPEG-2 Systems standard), ISO/IEC 13818-1. SCTE 142 Recommended Practice for Transport Stream monitoring www.trivenidigital.com ATSC A/78 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 71

Your Triveni Digital Contacts Ruben I. Araza Senior Sales Engineer raraza@trivenidigital.com Mobile # 928-785-2050 Anthony Flatt Director, Broadband Sales aflatt@trivenidigital.com Mobile # 404-713-7321 An LG Electronics Company Copyright 2011 Triveni Digital, Inc. Page 72

Thanks for Attending! Triveni Digital Inc. MPEG Technology Series MPEG 101 An LG Electronics Company Copyright 2011 Triveni Digital, Inc.