Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×

Phil Hippensteel on MPEG Compression and MPEG Transport

Our focus in this newsletter will be on two terms that are often confused: mpeg compression and  mpeg-2 transport stream.   The first is a series of techniques which are used to compress video in efficient manner without significantly degrading the quality of the output to the display device.   The second is a format for laying out the compressed video data to provide efficient transport across a link or a network.

H.264

MPEG refers to the Motion Pictures Experts Group, a part of the ISO/ITC standards organization.  We’ll focus on H.264, more properly titled H.264 MPEG-4 Part 10 Advanced Video Coding.  This is the most popular codec in use today.  A codec is generally considered to be a device or software that converts a signal into digital form.  It may or may not involve compression.  However, more often than not, compression is involved.   The H.264 standard was developed to replace the MPEG-2 codec that had been used for about two decades.

Understanding both H.264 compression and the mpeg transport requires awareness of  the concepts of I, P and B frames and the GOPs, groups of pictures,  they make.  When the camera captures the motion in a scene it does it at a particular frame rate, such as 30 frames per second.  Each of these frames is digitized and optionally compressed.  An I-frame, called an intraframe, is a compressed video frame that contains enough information in order that the frame can be recreated at the presentation point without the information from any other frame.   JPEG2000 is essentially a stream of I-frames.  Many people think of an I-frame as a jpeg image, like a digital still camera would create.  However, in some applications, a second type of frame is used, called a P-frame or predicted frame.  The encoder analyzes the content of an I-frame and compares it to what it sees in later frames.  It then uses the differences in the scene and some components of the P-frame.  It also uses motion vectors to indicate that parts of the I-frame that just moved to a different position in the follow-on frame.  By doing this, the information necessary to rebuild the follow-on frame can be recreated at the presentation point with one half or less data that would be used in an I-frame. 

Finally, the compression process can use an I-frame and a later I- or P-frame and interpolate to estimate what intervening frames would have looked like.  These smallest compressed frames are called bi-direction or B-frames. So, to summarize, consider the stream of frames in Figure 1.

The first four frames can comprise a Group of Pictures (GOP). Such GOP is a group that goes from  I-frame to the next I-frame.  In our example, we say the GOP length is 4.

The first four frames can comprise a Group of Pictures (GOP). Such GOP is a group that goes from  I-frame to the next I-frame.  In our example, we say the GOP length is 4.

Once these frames are compressed as described, the data is arranged in a stream called an elementary stream.  We refer to the device that creates these streams an encoder.  This stream is packetized into a packetized elementary stream (PES) since it is divided into blocks or packets.

The Mpeg Transport Stream (MP2TS or MPTS)

In order to send this stream across a packetized network, the stream of video data is now multiplexed or mixed in with the associated audio stream(s).  The video and audio streams are created as separate PES. Once multiplexed, they make a transport stream, TS.  The encoder takes blocks of 184 bytes of data from each of the streams, adds a four byte header to each and creates what is known as an mpeg packet.  As in Figure 2, these are multiplexed and placed in IP packets.  Since each IP packet usually does not exceed 1460 bytes (a restriction from the early days of Ethernet and IP), seven mpeg packet can fit into each IP packet.  Everything needed to play out the audio and video in a synchronized manner is in these 188 byte packets

.

Featured Articles

Close