mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
finger out the PES_packet_length is 0
This commit is contained in:
parent
dc7f2cff86
commit
a0ecc5a305
2 changed files with 276 additions and 147 deletions
|
@ -228,52 +228,114 @@ TS
|
|||
|
||||
|
||||
|
||||
3031个ts包是空包,解析有问题:
|
||||
47 41 00 38 07 50 05 09 5A A6 7E 00 00 00 01 E0
|
||||
00 00 80 C0 0A 31 28 53 60 81 11 28 53 42 F9 00
|
||||
00 00 01 09 F0 00 00 00 01 67 64 00 28 AC D1 C0
|
||||
50 05 BB FF 00 2D 00 22 10 00 00 03 00 10 00 00
|
||||
03 03 08 F1 83 11 E0 00 00 00 01 68 E9 AB 2C 8B
|
||||
00 00 01 65 88 84 00 42 BF 08 EE 00 02 B2 75 8D
|
||||
9F C4 24 E5 BD 27 87 F1 E4 09 A0 51 2D 12 FC F5
|
||||
6E 31 3D C4 0E 3F 51 47 07 BD D2 8C AB 72 1C 2D
|
||||
D0 FA 2F 7D EF AA FB 17 C1 08 AD 36 8D F1 41 35
|
||||
E0 20 AE E8 75 66 39 15 78 88 01 E8 2E 4E 8A 8B
|
||||
F8 04 68 BF EC 82 59 86 DE E1 66 32 37 FA 78 6D
|
||||
01 EF C0 2C 6B A6 E9 36 44 4B C8 37
|
||||
|
||||
Adaptation fields
|
||||
Adaptation_field_length: 7
|
||||
discontinuity_indicator: False
|
||||
random_access_indicator: True
|
||||
ES_priority_indicator: False
|
||||
PCR_flag: True
|
||||
OPCR_flag: False
|
||||
splicing_point_flag: False
|
||||
transport_private_data_flag: False
|
||||
adaptation_field_extension_flag: False
|
||||
PCR: 50699466000
|
||||
|
||||
PES header
|
||||
stream_id: E0 (video stream 224)
|
||||
PES_packet_length: 0 (undefined)
|
||||
PES_scrambling: 0
|
||||
PES_priority: False
|
||||
data_alignment: False
|
||||
copyright: False
|
||||
original_or_copy: False
|
||||
PTS_flag: True
|
||||
DTS_flag: True
|
||||
ESCR_flag: False
|
||||
ES_rate_flag: False
|
||||
DSM_trick_mode_flag: False
|
||||
additional_copy_info_flag: False
|
||||
PES_CRC_flag: False
|
||||
PES_extension_flag: False
|
||||
PES_header_data_length: 10
|
||||
PTS: 169128000
|
||||
DTS: 169124220
|
||||
|
||||
Video sequence
|
||||
Sequence header code not found in this packet
|
||||
AFD not found in this packet
|
||||
第3030个包解析有点问题,设置条件断点:
|
||||
condition 1 ctx->ts_packet_count == 3030
|
||||
发现数据如下:
|
||||
(gdb) x /188xb 0x7fffffffe2f0
|
||||
0x7fffffffe2f0: 0x47 0x41 0x00 0x38 0x07 0x50 0x05 0x09
|
||||
0x7fffffffe2f8: 0x5a 0xa6 0x7e 0x00 0x00 0x00 0x01 0xe0
|
||||
0x7fffffffe300: 0x00 0x00 0x80 0xc0 0x0a 0x31 0x28 0x53
|
||||
0x7fffffffe308: 0x60 0x81 0x11 0x28 0x53 0x42 0xf9 0x00
|
||||
0x7fffffffe310: 0x00 0x00 0x01 0x09 0xf0 0x00 0x00 0x00
|
||||
0x7fffffffe318: 0x01 0x67 0x64 0x00 0x28 0xac 0xd1 0xc0
|
||||
0x7fffffffe320: 0x50 0x05 0xbb 0xff 0x00 0x2d 0x00 0x22
|
||||
0x7fffffffe328: 0x10 0x00 0x00 0x03 0x00 0x10 0x00 0x00
|
||||
0x7fffffffe330: 0x03 0x03 0x08 0xf1 0x83 0x11 0xe0 0x00
|
||||
0x7fffffffe338: 0x00 0x00 0x01 0x68 0xe9 0xab 0x2c 0x8b
|
||||
0x7fffffffe340: 0x00 0x00 0x01 0x65 0x88 0x84 0x00 0x42
|
||||
0x7fffffffe348: 0xbf 0x08 0xee 0x00 0x02 0xb2 0x75 0x8d
|
||||
0x7fffffffe350: 0x9f 0xc4 0x24 0xe5 0xbd 0x27 0x87 0xf1
|
||||
0x7fffffffe358: 0xe4 0x09 0xa0 0x51 0x2d 0x12 0xfc 0xf5
|
||||
0x7fffffffe360: 0x6e 0x31 0x3d 0xc4 0x0e 0x3f 0x51 0x47
|
||||
0x7fffffffe368: 0x07 0xbd 0xd2 0x8c 0xab 0x72 0x1c 0x2d
|
||||
0x7fffffffe370: 0xd0 0xfa 0x2f 0x7d 0xef 0xaa 0xfb 0x17
|
||||
0x7fffffffe378: 0xc1 0x08 0xad 0x36 0x8d 0xf1 0x41 0x35
|
||||
0x7fffffffe380: 0xe0 0x20 0xae 0xe8 0x75 0x66 0x39 0x15
|
||||
0x7fffffffe388: 0x78 0x88 0x01 0xe8 0x2e 0x4e 0x8a 0x8b
|
||||
0x7fffffffe390: 0xf8 0x04 0x68 0xbf 0xec 0x82 0x59 0x86
|
||||
0x7fffffffe398: 0xde 0xe1 0x66 0x32 0x37 0xfa 0x78 0x6d
|
||||
0x7fffffffe3a0: 0x01 0xef 0xc0 0x2c 0x6b 0xa6 0xe9 0x36
|
||||
0x7fffffffe3a8: 0x44 0x4b 0xc8 0x37
|
||||
header解析如下:
|
||||
(gdb) p *this
|
||||
$74 = {_vptr.TSHeader = 0x4080b0, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 1 '\001', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypeBoth, continuity_counter = 8 '\b'}
|
||||
(gdb) p ctx->get(pid)[0]
|
||||
$76 = {type = TSPidTypeVideo, stream_type = TSStreamTypeVideoH264, pid = 256, continuity_counter = 8 '\b'}
|
||||
(gdb) p ctx->get_msg(256)[0]
|
||||
$124 = {_vptr.TSMessage = 0x408290, pid = 256, type = TSPidTypeVideo, stream_type = TSStreamTypeVideoH264,
|
||||
continuity_counter = 8 '\b', PES_packet_length = 0, stream_id = 224 '\340', packet_start_code_prefix = 1,
|
||||
packet_header_size = 13, parsed_packet_size = 144, packet_data_size = 144, packet_data = 0x60b300 ""}
|
||||
特殊的是:PES_packet_length为0,也就是未知长度。
|
||||
解析下一个包,header为:
|
||||
(gdb) p header[0]
|
||||
$123 = {_vptr.TSHeader = 0x408170, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 9 '\t'}
|
||||
这个包的标识是continuity_counter为上一个包的连续。这个包里面是纯粹的数据:
|
||||
(gdb) x /184xb 0x7fffffffe2f4
|
||||
0x7fffffffe2f4: 0x9c 0xfa 0x8c 0xc9 0x02 0x36 0xc2 0x46
|
||||
0x7fffffffe2fc: 0x97 0x01 0x31 0x3d 0xfa 0x83 0xc2 0x88
|
||||
0x7fffffffe304: 0x6b 0xb3 0x1c 0x63 0xcf 0xc6 0xc4 0xa6
|
||||
0x7fffffffe30c: 0xe2 0xa7 0xb3 0x26 0x62 0x7e 0xb4 0xf0
|
||||
0x7fffffffe314: 0x17 0x13 0x4c 0xd5 0x1b 0xee 0x80 0x37
|
||||
0x7fffffffe31c: 0x8f 0x6a 0xad 0x41 0x8f 0x43 0x39 0xbe
|
||||
0x7fffffffe324: 0x2f 0x51 0xb4 0x0a 0x54 0x62 0xab 0xdc
|
||||
0x7fffffffe32c: 0x11 0x92 0x92 0x85 0x18 0x92 0x29 0xd5
|
||||
0x7fffffffe334: 0xb5 0xbc 0x00 0x9e 0x26 0xc3 0xa4 0x04
|
||||
0x7fffffffe33c: 0xb6 0x97 0x62 0x9b 0x3b 0x3c 0x09 0x6b
|
||||
0x7fffffffe344: 0x68 0x15 0xe7 0xcc 0x71 0xd9 0xb5 0x02
|
||||
0x7fffffffe34c: 0x19 0x8a 0x06 0x90 0x22 0xcd 0x3e 0x82
|
||||
0x7fffffffe354: 0xff 0x48 0x73 0x8b 0x00 0xdc 0xe5 0xdb
|
||||
0x7fffffffe35c: 0x83 0x13 0x5e 0xe8 0x63 0xe9 0xb6 0xf0
|
||||
0x7fffffffe364: 0xc5 0x21 0x03 0x57 0xfb 0xb2 0xe1 0x9c
|
||||
0x7fffffffe36c: 0x71 0x3e 0x36 0xe3 0x05 0xb7 0xf1 0x85
|
||||
0x7fffffffe374: 0x88 0x0e 0x51 0x52 0xd8 0x3c 0x80 0x1a
|
||||
0x7fffffffe37c: 0x34 0xff 0xd9 0x5f 0x69 0xb4 0x9d 0xd7
|
||||
0x7fffffffe384: 0xc2 0x21 0xa8 0x85 0xc8 0xa2 0xdd 0xb8
|
||||
0x7fffffffe38c: 0xa3 0x43 0x2f 0x7e 0xc8 0xac 0x1b 0x67
|
||||
0x7fffffffe394: 0x17 0x6c 0x74 0xea 0x97 0xb8 0xa4 0xcf
|
||||
0x7fffffffe39c: 0x43 0xf3 0x1c 0xad 0x89 0x91 0x28 0x49
|
||||
0x7fffffffe3a4: 0xf2 0xe8 0x0c 0xbf 0x75 0x8a 0x1c 0xac
|
||||
后续还有几个包:
|
||||
$136 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 10 '\n'}
|
||||
$137 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 11 '\v'}
|
||||
$138 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 12 '\f'}
|
||||
$141 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 13 '\r'}
|
||||
$142 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 14 '\016'}
|
||||
$143 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 15 '\017'}
|
||||
然后,这个包变了,但是还是继续前面的包,因为是0xF溢出:
|
||||
$144 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 0 '\000'}
|
||||
$148 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 0 '\000', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 1 '\001'}
|
||||
如此循环,可以循环很多次。一直到这个包:
|
||||
$556 = {_vptr.TSHeader = 0x408250, sync_byte = 71 'G', transport_error_indicator = 0 '\000',
|
||||
payload_unit_start_indicator = 1 '\001', transport_priority = 0 '\000', pid = 256,
|
||||
transport_scrambling_control = 0 '\000', adaption_field_control = TSAdaptionTypePayloadOnly,
|
||||
continuity_counter = 4 '\004'}
|
||||
其中的:payload_unit_start_indicator为1。
|
Loading…
Add table
Add a link
Reference in a new issue