Packetized elementary stream

From Wikipedia, the free encyclopedia


Packetized Elementary Stream (PES) is a specification defined by the MPEG communication protocol (see the MPEG-2 standard) that allows an Elementary stream to be divided into packets[1]. 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. The TS packets can then be multiplexed and transmitted using broadcasting techniques, such as those used in an ATSC and DVB.

Contents

[edit] 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) [2]

[3] [4] [5]

Note: The above 4 bytes is called the 32 bit start code.
PES Packet length 2 bytes Can be zero as in not specified for video streams in transport streams
Optional PES header variable length
Stuffing bytes variable length
Data See elementary stream

[edit] Optional PES header

Name Number of Bits Description
Marker bits 2 10 binary or 0x2 hex
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
Copyright 1 1 implies copyrighted
Original or Copy 1 1 implies original
PTS DTS indicator 2 11 implies both present, 10 implies 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

[edit] References

  1. ^ http://neuron2.net/library/mpeg2/iso13818-1.pdf
  2. ^ http://www.dvb.org/technology/standards/a001r7.tm1214r30.dTS101154.v1.8.1.pdf>
  3. ^ Method and apparatus for changing codec to reproduce video and/or audio data streams encoded by different codecs within a channel - Patent EP1827030
  4. ^ European publication server
  5. ^ https://publications.european-patent-office.org/PublicationServer/document.jsp?PN=EP1827030%20EP%201827030&iDocId=6296342&iFormat=0

[edit] External links