Packetized elementary stream

<!- A typicalfrom 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.[1]

PES packet header

NameSizeDescription
Packet start code prefix3 bytes0x000001
Stream id1 byteExamples: 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 length2 bytesSpecifies the number of bytes remaining in the packet after this field. 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.[6]
Optional PES headervariable length (length >= 9)not present in case of Padding stream & Private stream 2 (navigation data)
Stuffing bytesvariable length
Data See elementary stream. In the case of private streams the first byte of the payload is the sub-stream number.

Optional PES header

NameNumber of BitsDescription
Marker bits210 binary or 0x2 hex
Scrambling control200 implies not scrambled
Priority1
Data alignment indicator11 indicates that the PES packet header is immediately followed by the video start code or audio syncword
Copyright11 implies copyrighted
Original or Copy11 implies original
PTS DTS indicator211 = both present, 01 is forbidden, 10 = only PTS, 00 = no PTS or DTS
ESCR flag1
ES rate flag1
DSM trick mode flag1
Additional copy info flag1
CRC flag1
extension flag1
PES header length8gives the length of the remainder of the PES header
Optional fieldsvariable lengthpresence is determined by flag bits above
Stuffing Bytesvariable length0xff

While above flags indicate that values are appended into variable length optional fields, they are not just simply written out. For example, PTS (and DTS) is expanded from 33 bits to 5 bytes (40 bits). If only PTS is present, this is done by catenating 0010b, most significant 3 bits from PTS, 1, following next 15 bits, 1, rest 15 bits and 1. If both PTS and DTS are present, first 4 bits are 0011 and first 4 bits for DTS are 0001. Other appended bytes have similar but different encoding.

References

  1. ISO (2000-12-01) ISO/IEC 13818-1 : 2000, Second edition, Retrieved on 2009-07-25
  2. http://www.etsi.org/deliver/etsi_ts/101100_101199/101154/01.09.01_60/ts_101154v010901p.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
  6. http://happy.emu.id.au/lab/tut/dttb/dtbtut4b.htm#s4p4>

External links

This article is issued from Wikipedia - version of the Thursday, February 11, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.