Penguin
Note: You are viewing an old revision of this page. View the current version.

Some of the more esoteric terms and concepts you may come across in MPEG.

“Streams” in MPEG are actually called packetized elementary streams (PES), because the data is divided up into packets, each of which begins with a PES header. Each PES header can contain a presentation time stamp (PTS) which synchronizes the time at which that data is to be decoded and presented to the viewer, along with corresponding data from the other streams.

Not every PES packet has to have a PTS, but there must be at least one every 0.7 seconds, in order to ensure the decoder clock stays in sync. The PTS is a 33-bit unsigned integer, in units of a 90kHz clock.

A packet belonging to one stream (say, video) will invariably be immediately followed by one belonging to another stream (say, audio), with around the same PTS. This interleaving or multiplexing of data from different streams minimizes the amount of buffering the decoder has to implement in order to provide smoothly synchronized playback.

An MPEG file/bytestream could just consist of an unadorned sequence of PES packets, but this is not usually done. Instead, MPEG is normally represented in either transport stream (MPEG-TS) or program stream(MPEG-PS) formats.

In transport stream format, the PES packets are sliced into small pieces, each of which is carried in a transport-stream packet. This is intended for use in transmission over less-than-fully-reliable channels (e.g. broadcast over the air), where a momentary burst of interference or loss of signal will only lose some transport-stream packets.

In program stream format, PES packets are grouped into packs, each beginning with a pack header. Though calling this a “header” is a bit of a misnomer, since it is effectively a packet in its own right, and in particular it has no length field that includes any following PES packets. The purpose of the pack header is to 1) contain a more precise clock reference (units of 27MHz instead of 90kHz) and 2) give the decoder some indication of the rate at which it will have to transfer data in order to play the movie.