Packetized Elementary Stream
Encyclopedia
Packetized Elementary Stream (PES) is a specification in the MPEG-2
Part 1 (Systems) (ISO/IEC 13818-1) and ITU-T H.222.0 that defines carrying of elementary stream
s in packets within MPEG program stream and MPEG transport stream. The elementary stream is packetized by encapsulating sequential data bytes from the elementary stream inside PES packet headers.
A typical method of transmitting elementary stream data from a video or audio encoder is to first create PES packets from the elementary stream data and then to encapsulate these PES packets inside Transport Stream (TS) packets or Program Stream (PS). The TS packets can then be multiplexed and transmitted using broadcasting techniques, such as those used in an ATSC
and DVB.
Transport Streams and Program Streams are each logically constructed from PES packets. PES packets shall be used to convert between Transport Streams and Program Streams. In some cases the PES packets need not be modified when performing such conversions. PES packets may be much larger than the size of a Transport Stream packet.
MPEG-2
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...
Part 1 (Systems) (ISO/IEC 13818-1) and ITU-T H.222.0 that defines carrying of elementary stream
Elementary stream
An elementary stream as defined by MPEG communication protocol is usually the output of an audio or video encoder. ES contains only one kind of data, e.g. audio, video or closed caption. An elementary stream is often referred to as "elementary", "data", "audio", or "video" bitstreams or streams...
s in packets within MPEG program stream and MPEG transport stream. The elementary stream is packetized by encapsulating sequential data bytes from the elementary stream inside PES packet headers.
A typical method of transmitting elementary stream data from a video or audio encoder is to first create PES packets from the elementary stream data and then to encapsulate these PES packets inside Transport Stream (TS) packets or Program Stream (PS). The TS packets can then be multiplexed and transmitted using broadcasting techniques, such as those used in an ATSC
ATSC tuner
An ATSC tuner, often called an ATSC receiver or HDTV tuner is a type of television tuner that allows reception of digital television television channels transmitted by television stations in North America, parts of Central America and South Korea that use ATSC standards...
and DVB.
Transport Streams and Program Streams are each logically constructed from PES packets. PES packets shall be used to convert between Transport Streams and Program Streams. In some cases the PES packets need not be modified when performing such conversions. PES packets may be much larger than the size of a Transport Stream packet.
PES packet header
Name | Size | Description |
---|---|---|
Packet start code prefix | 3 bytes | 0x000001 |
Stream id | 1 byte | Examples: Audio streams (0xC0-0xDF), Video streams (0xE0-0xEF) |
Note: The above 4 bytes is called the 32 bit start code. | ||
PES Packet length | 2 bytes | Can be zero. If the PES packet length is set to zero, the PES packet can be of any length. A value of zero for the PES packet length can be used only when the PES packet payload is a video elementary stream. |
Optional PES header | variable length | |
Stuffing bytes | variable length | |
Data | See elementary stream Elementary stream An elementary stream as defined by MPEG communication protocol is usually the output of an audio or video encoder. ES contains only one kind of data, e.g. audio, video or closed caption. An elementary stream is often referred to as "elementary", "data", "audio", or "video" bitstreams or streams... . In the case of private streams the first byte of the payload is the sub-stream number. |
Optional PES header
Name | Number of Bits | Description |
---|---|---|
Marker bits | 2 | 10 binary Binary numeral system The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2... or 0x2 hex Hexadecimal In mathematics and computer science, hexadecimal is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen... |
Scrambling control | 2 | 00 implies not scrambled |
Priority | 1 | |
Data alignment indicator | 1 | 1 indicates that the PES packet header is immediately followed by the video start code or audio syncword Syncword In computer networks, a syncword, sync character or preamble is used to synchronize a transmission by indicating the end of header information and the start of data.-Examples:For example an audio receiver is receiving a bit stream of data... |
Copyright | 1 | 1 implies copyrighted |
Original or Copy | 1 | 1 implies original |
PTS DTS indicator | 2 | 11 = both present, 10 = only PTS |
ESCR flag | 1 | |
ES rate flag | 1 | |
DSM trick mode flag | 1 | |
Additional copy info flag | 1 | |
CRC flag | 1 | |
extension flag | 1 | |
PES header length | 8 | gives the length of the remainder of the PES header |
Optional fields | variable length | presence is determined by flag bits above |
Stuffing Bytes | variable length | 0xff |
External links
- http://www.bretl.com/mpeghtml/pespckt.HTM
- http://dvd.sourceforge.net/dvdinfo/pes-hdr.html
- ISOInternational Organization for StandardizationThe International Organization for Standardization , widely known as ISO, is an international standard-setting body composed of representatives from various national standards organizations. Founded on February 23, 1947, the organization promulgates worldwide proprietary, industrial and commercial...
/IECInternational Electrotechnical CommissionThe International Electrotechnical Commission is a non-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies – collectively known as "electrotechnology"...
standard 13818-1http://neuron2.net/library/mpeg2/iso13818-1.pdf)