TS流分析
1. 文件来源
Ø PS文件:prison_break_clip0.mpg
Ø TS抓包文件:dump:http://dl2.csdn.net/down4/20070729/29203617214.dump
2. TS流分析
2.1 PAT
(1) 起始地址:0x001e
(2) 各字段内容:
Header:
sync_byte(1B):0x47
transport_error_indicator (1b):0
payload_unit_start_indicator(1b):
1, 该字段置1表示携带的是PSI或PES第一个包
transport_priority(1b):0
PID(13b):0 0000 0000 0000,说明携带的是PAT表
Transport_scrambling_control(2b):00
Adaptation_field_control(2b):11,标识既有adaptation_field又有payload
Adaptation_field:
adaptation_field_length(1B):0xa6
discontinuity_indecator(1b):0
random_access_indicator(1b):0
elementary_stream_priority_indicator(1b):0
PCR_flag(1b):0
OPCR_flag(1b):0
splicing_point_flag(1b):0
transport_private_data_flag(1b):0
adaptation_field_extension_flag(1b):0
stuffing_bytes:填充0xff,结束地址:0x00c6
point_field(1B):0x00
Program Association Section:
table_id(1B):0x00,PAT表固定值
section_syntax_indicator(1b):1
‘0’
‘11’
section_length(12b):0x 0 0d
transport_stream_id(2B):0x 4b 7c,为何是这个值??????
‘11’
version_number(5b):00 101
current_next_indicator(1b):0
section_number(1B):0x 00
last_section_number(1B):0x 00
进入N _loop循环
program_number(2B):0x 00 01
‘111’
program_map_PID(13b):0 0000 0100 0010(0x42)
CRC32(4B):0xbec6 cee3
2.2 PMT
(1)起始地址:0x00d8
(2)各字段内容:
Header:
sync_byte(1B):0x47
transport_error_indicator (1b):0
payload_unit_start_indicator(1b):
1, 该字段置1表示携带的是PSI或PES第一个包
transport_priority(1b):0
PID(13b):0 0000 0100 0010(0x42),说明携带的是节目1的PMT表
Transport_scrambling_control(2b):00
Adaptation_field_control(2b):11,标识既有adaptation_field又有payload
Adaptation_field:
adaptation_field_length(1B):0x9c
discontinuity_indecator(1b):0
random_access_indicator(1b):0
elementary_stream_priority_indicator(1b):0
PCR_flag(1b):0
OPCR_flag(1b):0
splicing_point_flag(1b):0
transport_private_data_flag(1b):0
adaptation_field_extension_flag(1b):0
stuffing_bytes:填充0xff,结束地址:0x0178
point_field(1B):0x00
Program Map Section:
table_id(1B):0x02,PMT表固定值
section_syntax_indicator(1b):1
‘0’
‘11’
section_length(12b):0x 0 17
program number(2B):0x00 01
‘11’
version_number(5b):11 100
current_next_indicator(1b):1
section_number(1B):0x 00
last_section_number(1B):0x 00
‘111’
PCR_PID(13b):0 0000 0100 0100(0x44)
‘1111’
program_info_length(12b):0000 0000 0000
进入N _loop循环
stream_type(1B):0x 02 (13818-2 Video stream)
elementarty_PID(13b):0 0000 0100 0100(0x44)//为何为0x44,用户自定义???
‘1111’
ES_info_length(12b):0000 0000 0000
stream_type(1B):0x03 (ISO/IEC 11172Audio,为什么不是04 13818-3video??)
‘111’
elementary_PID(13b):0 0000 0100 1001 (0x45)
‘1111’
ES_info_length(12b):0000 0000 0000
CRC_32(4B):0x73cf 72ce
2.3 PES
(1)起始地址:0x0194
(2)各字段内容:
Header:
sync_byte(1B):0x47
transport_error_indicator (1b):0
payload_unit_start_indicator(1b):
2, 该字段置1表示携带的是PSI或PES第一个包
transport_priority(1b):0
PID(13b):0 0000 0100 0100(0x44),说明携带的是节目1的视频PES
Transport_scrambling_control(2b):00
Adaptation_field_control(2b):11,标识既有adaptation_field又有payload
Adaptation_field:
adaptation_field_length(1B):0x07
discontinuity_indecator(1b):0
random_access_indicator(1b):0
elementary_stream_priority_indicator(1b):0
PCR_flag(1b):1
OPCR_flag(1b):0
splicing_point_flag(1b):0
transport_private_data_flag(1b):0
adaptation_field_extension_flag(1b):0
program_clock_reference_base(33b): 0101 0010 0011 0101 0111 0111 0101 0011 0
reserved(6b):111 111
program_clock_reference_extension(9b):0 0000 0000
PES:
packet_start_code_prefix(24b):0x00 00 01
stream_id(1B):0xe0
PES_packet_length(2B):0x20cf,PS上为0x07ec???????
optional_PES_HEADER:
‘10’
PES_scrambling_control(2b):00
PES_priority(1b):0
data_alignment_indicator(1b):0
copyright(1b):0
original_or_copy(1b):0
PTS_DTS_flags(2b):11
ESCR_flag(1b):0
ES_rate_flag(1b):0
DSM_trick_mode_flag(1b):0
additional_copy_info_flag(1b):0
PES_CRC_flag(1b):0
PES_extension_flag(1b):0
PES_header_data_length(1B):0x0a
PTS_DTS(10B):0x 35 91af 1293 1591 adf5 41,
PS中为 0x 31 00 01 a9 f3 11 00 01 8c a1,为何不同?
video_sequence:和PS中完全相同