您的位置:首页 > 其它

DVD-Video 解谜 - 相关信息 - Packetized Elementary Stream headers描述

2007-04-27 15:10 411 查看

Packetized Elementary Stream Headers

Depending on the Stream ID, a Packetized Elementary Stream (PES) header may contain various components.

The header

byte 0byte 1byte 2byte 3byte 4byte 5
0000 0000 0000 0000 0000 0001
Start code
Stream IDPES packet length
Stream ID's which pertain to DVD
Stream IDStream typeextension present?
1011 1101
0xBD
Private stream 1 (non MPEG audio, subpictures)Yes
1011 1110
0xBE
Padding streamNo
1011 1111
0xBF
Private stream 2 (navigation data)No
110x xxxx
0xC0 - 0xDF
MPEG-1 or MPEG-2 audio stream number x xxxx
note: DVD allows only 8 audio streams
Yes
1110 xxxx
0xE0 - 0xEF
MPEG-1 or MPEG-2 video stream number xxxx
note: DVD allows only 1 video stream
Yes

The extension

byte 6byte 7byte 8
765432107654321076543210
10PES scrambling controlPES prioritydata alignment indicatorcopyrightoriginal or copyPTS DTS flagsESCR flagES rate flagDSM trick mode flagadditional copy info flagPES CRC flagPES extension flagPES header data length
The bit fields of the basic extension:
PES scrambling control -- 00 = not scrambled, others are user defined.

PES priority -- provides 2 priority levels, 0 and 1.

data alignment indicator -- if set to 1 indicates that the PES packet header is immediately followed by the video start code or audio syncword.

copyright -- 1 = packet contains copyrighted material.

original or copy -- 1 = original, 0 = copy.

PTS DTS flags -- Presentation Time Stamp / Decode Time Stamp. 00 = no PTS or DTS data present, 01 is forbidden.
if set to 10 the following data is appended to the header data field:
7654321076543210765432107654321076543210
0010PTS 32..301PTS 29..151PTS 14..001
PTS DTS flags -- if set to 11 the following data is appended to the header data field:
7654321076543210765432107654321076543210
0011PTS 32..301PTS 29..151PTS 14..001
0001DTS 32..301DTS 29..151DTS 14..001
presentation and decoder time stamps use the 90KHz clock (SCR / 300)

ESCR -- if set to 1 the following data is appended to the header data field:
765432107654321076543210765432107654321076543210
00ESCR base 32..301ESCR base 29..151ESCR base 14..001ESCR ext1
This is the Elementary Stream Clock Reference, used if the stream and system levels are not synchronized (i.e. ESCR differs from SCR in the PACK header).

ES rate -- if set to 1 the following data is appended to the header data field:
765432107654321076543210
1ES rate1
The rate at which data is delivered for this stream, in units of 50 bytes/second.

DSM trick mode - not used by DVD

additional copy info -- if set to 1 the following data is appended to the header data field:
76543210
1additional copy info
PES CRC flag -- if set to 1 the following data is appended to the header data field:
7654321076543210
previous PES packet CRC
The polynomial used is X16 + X12 + X5 + 1

PES extension flag -- if set to 1 the following data is appended to the header data field:
76543210
PES private data flagpack header field flagprogram packet sequence counter flagP-STD buffer flag111PES extension flag 2
The bit fields of the first extension:

PES private data flag -- if set to 1 16 bytes of user defined data is appended to the header data field.

pack header field flag -- if set to 1 the 8-bit pack field length value is appended to the header data field.

program packet sequence counter flag -- if set to 1 the following data is appended to the header data field:
7654321076543210
1packet sequence counter1MPEG1_MPEG2 identifieroriginal stuffing length
P-STD buffer flag -- if set to 1 the following data is appended to the header data field:
7654321076543210
01P-STD buffer scale
0 = 128 bytes
1 = 1024 bytes
P-STD buffer size
PES extension flag 2 -- if set to 1 the following data is appended to the header data field:
7654321076543210
1PES extension field lengthreserved
Which is then followed by the indicated number of bytes.

The rest of the packet

Following all the extension data are optional stuffing bytes (0xFF), which are included in the header data length, and then the payload.
In the case of private streams the first byte of the payload is the sub-stream number.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: