Packetized elementary stream

Packetized elementary stream

http://en.wikipedia.org/wiki/Packetized_elementary_stream

Packetized Elementary Stream (PES) is a specification in the MPEG-2 Part 1 (Systems) (ISO/IEC 13818-1) and ITU-T H.222.0[1][2] that defines carrying ofelementary streams (usually the output of an audio or video encoder) in packets within MPEG program stream and MPEG transport stream.[3] The elementary stream ispacketized 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) packets. 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.[3]

Contents

   [hide

PES packet header[edit]

Name Size Description
Packet start code prefix3 bytes0x000001
Stream id1 byteExamples: Audio streams (0xC0-0xDF), Video streams (0xE0-0xEF) [4] [5] [6] [7]
  Note: The above 4 bytes is called the 32 bit start code.
PES Packet length2 bytesCan 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.[8]
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[edit]

Name Number of Bits Description
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, 1 = only PTS
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 5 bits for DTS are 0001. Other appended bytes have similar but different encoding.

References


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值