winlin

remove the analysis doc for ts

packet#7:
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: 50572350000
PES header
stream_id: E0 (video stream 224)
PES_packet_length: 35808
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: 168704280
DTS: 168700500
packet#665:
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: 50616225000
PES header
stream_id: E0 (video stream 224)
PES_packet_length: 29213
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: 168850530
DTS: 168846750
参考nginx-rtmp函数:ngx_rtmp_mpegts_write_frame
其中,nginx-rtmp写入PCR的逻辑如下:
if (f->key) {
packet[3] |= 0x20; /* adaptation */
*p++ = 7; /* size */
*p++ = 0x50; /* random access + PCR */
p = ngx_rtmp_mpegts_write_pcr(p, f->dts - NGX_RTMP_HLS_DELAY);
}
只要碰到关键帧,就写入PCR。
ngx_rtmp_mpegts_write_pcr(u_char *p, uint64_t pcr)
{
*p++ = (u_char) (pcr >> 25);
*p++ = (u_char) (pcr >> 17);
*p++ = (u_char) (pcr >> 9);
*p++ = (u_char) (pcr >> 1);
*p++ = (u_char) (pcr << 7 | 0x7e);
*p++ = 0;
return p;
}
即将高9位置0,6个reserverd置1,低33位输出(little-endian)。
nginx-rtmp写入dts的逻辑如下:
p = ngx_rtmp_mpegts_write_pts(p, 1, f->dts + NGX_RTMP_HLS_DELAY);
也就是说,
pcr = f->dts - NGX_RTMP_HLS_DELAY
f->dts = dts - NGX_RTMP_HLS_DELAY
计算出来的:
pcr = program_clock_reference_base = 168574500
dts = 168700500
168574500 = 168700500 - 63000 - 63000
可见,工具MPEG-2 TS packet analyser分析出来的pcr是不对的。
解码出来的结果:
demuxer+read packet 0006 0001128 0x47 0x41 0x00 0x35 ... 0xb6 0x9f 0x89
ts+af af flags parsed, discontinuity: 0 random: 1 priority: 0 PCR: 1 OPCR: 0 slicing: 0 private: 0 extension: 0 pcr: 168574500 opcr: 0
ts+pes stream_id: 224 size: 35808 pts: 168704280 dts: 168700500 total: 35808 header: 13 packet_size: 35795 parsed_size: 157
ts-audio-video-analysis.ts is generated by nginx-rtmp.
AUDIO 0x0F ISO/IEC 13818-7 Audio with ADTS transport syntax
110x xxxx ISO/IEC 13818-3 or ISO/IEC 11172-3 or ISO/IEC 13818-7 or ISO/IEC 14496-3 audio stream number x xxxx
(gdb) p /x pkt.payload[0].pmt[0].at(1)[0]
$55 = {stream_type = 0xf, elementary_PID = 0x101}
========================================================================
(gdb) x /584xb msg->packet_data
TS(AAC-ADTS) header, 7bytes
0x60a320: 0xff 0xf1 0x5c 0x80 0x23 0xdf 0xfc
FLV(AAC) header, 2bytes
0xaf 0x01
TS(AAC-ADTS) RAW data,
0x21 0x1a 0xcb 0xfe 0xfc 0xff 0xff 0xff 0x98
0x60a330: 0xb1 0x52 0xd8 0x88 0x43 0x28 0xc4 0xcb
0x60a338: 0x95 0x2c 0x9a 0x09 0x5c 0x00 0x9c 0xfb
0x60a340: 0x50 0xb9 0x3d 0xa8 0x96 0x02 0x47 0x68
0x60a348: 0xfb 0xb3 0x1c 0x26 0x2e 0xdb 0xac 0x8a
0x60a350: 0xec 0x81 0x65 0xae 0x56 0x45 0x65 0x40
0x60a358: 0xcb 0x8f 0xa5 0x6a 0xe8 0x18 0x05 0x90
0x60a360: 0x8e 0x24 0xb7 0x55 0x72 0x0a 0x6d 0x07
0x60a368: 0x9b 0xa5 0xca 0xd2 0xc8 0x6d 0x0f 0xd2
0x60a370: 0x42 0xf0 0x83 0x1d 0x24 0x60 0xba 0x89
0x60a378: 0x57 0x3f 0x70 0x0f 0xc7 0x18 0xbc 0xc6
0x60a380: 0x0a 0xf2 0x2f 0x75 0x46 0x94 0x0b 0x81
0x60a388: 0x24 0x2e 0xfa 0x9d 0xa1 0x50 0x17 0x04
0x60a390: 0x50 0x0b 0xde 0x86 0xe5 0x80 0x0a 0x68
0x60a398: 0x56 0x30 0x1d 0xbf 0xf5 0x56 0x87 0xab
0x60a3a0: 0x0f 0x30 0x8c 0x01 0x2b 0x3d 0x56 0xa6
0x60a3a8: 0xc7 0xe5 0xe1 0x83 0x76 0x8a 0xd4 0x7e
0x60a3b0: 0xc0 0x04 0xad 0x31 0x0c 0xe1 0x3b 0x80
0x60a3b8: 0x41 0x0d 0x00 0xb6 0x88 0xb0 0xe3 0x62
0x60a3c0: 0xda 0xf3 0xb2 0x58 0x12 0x1c 0x9a 0x5e
0x60a3c8: 0x4f 0x9c 0x63 0x5c 0xc1 0x99 0xc2 0x5e
0x60a3d0: 0xc6 0x82 0x5e 0x95 0x9d 0x80 0x91 0x57
0x60a3d8: 0x66 0x22 0xaf 0x60 0x68 0xcc 0x9d 0x40
0x60a3e0: 0x16 0xc0 0x6c 0xee 0x69 0xae 0xda 0x3f
0x60a3e8: 0x1e 0xe6 0x2e 0x55 0xbc 0xf8 0x60 0xda
0x60a3f0: 0x5f 0x0a 0x08 0x6e 0xbb 0x82 0x48 0x53
0x60a3f8: 0x46 0x29 0x10 0xb2 0x99 0x50 0x69 0xe2
0x60a400: 0x74 0xa9 0xf1 0x2e 0xce 0x40 0x0c 0x70
0x60a408: 0xce 0x92 0x17 0x5c 0x02 0xc0 0x6d 0x19
0x60a410: 0xc0 0x17 0x58 0xb2 0x16 0xb9 0x2c 0x55
0x60a418: 0xc0 0xe2 0xbe 0x75 0xe4 0x8e 0xb9 0xd5
0x60a420: 0x24 0x12 0x5c 0x53 0x1c 0xa5 0xb5 0x78
0x60a428: 0x05 0x1a 0x74 0x85 0xd5 0x00 0x6d 0x00
0x60a430: 0x20 0xc0 0x00 0x34 0x80 0x00 0x00 0x00
0x60a438: 0x00 0x00 0x00 0x00 0x00 0x70
========================================================================
TS(AAC-ADTS) header, 7bytes
0xff 0xf1 0x5c 0x80 0x25 0x5f 0xfc
FLV(AAC) header, 2bytes
0xaf 0x01
TS(AAC-ADTS) RAW data,
0x21 0x1a 0xcf
0x60a448: 0x77 0xff 0xff 0x7f 0xff 0x98 0xa6 0xb1
0x60a450: 0x85 0x0a 0x11 0x70 0x05 0xbd 0x0b 0xbb
0x60a458: 0x88 0x80 0x59 0x19 0xa4 0x89 0x0d 0x68
0x60a460: 0xb9 0x01 0xb2 0x4d 0x7d 0xd7 0x18 0xe5
0x60a468: 0x77 0x1e 0x4b 0x5b 0xa1 0xa9 0xd5 0x2a
0x60a470: 0x12 0x76 0xcb 0x35 0xb8 0x27 0xf1 0xab
0x60a478: 0xf0 0xf8 0xb7 0xe5 0xcf 0x49 0xaa 0x15
0x60a480: 0x53 0x9a 0xdf 0x6d 0x9c 0x76 0xe4 0xcb
0x60a488: 0x2d 0x83 0x88 0x31 0x8d 0x06 0x03 0xb4
0x60a490: 0xc5 0x68 0xf3 0xa9 0x70 0x8d 0x63 0x96
0x60a498: 0x02 0xa3 0xf5 0xf6 0x69 0x44 0xa4 0x3e
0x60a4a0: 0x1d 0x27 0x68 0x6c 0x37 0x58 0x46 0xe5
0x60a4a8: 0xc5 0x26 0x21 0x1a 0x2f 0xee 0xa4 0x71
0x60a4b0: 0x02 0x29 0x44 0x16 0x96 0x7e 0x4b 0x16
0x60a4b8: 0x76 0x47 0x55 0x8c 0x44 0x28 0xbc 0x42
0x60a4c0: 0x1f 0xab 0x54 0x5d 0xf6 0xba 0xc3 0x73
0x60a4c8: 0x69 0x99 0xa5 0x72 0x12 0xce 0x8c 0xd7
0x60a4d0: 0xdf 0xae 0x3e 0xfa 0x13 0x14 0x96 0x31
0x60a4d8: 0x20 0xca 0x2e 0x00 0x95 0x5c 0x44 0x84
0x60a4e0: 0x89 0x05 0xaf 0x4a 0xcb 0xab 0x40 0xd7
0x60a4e8: 0x9a 0x25 0x80 0xc7 0x67 0x6e 0x87 0x9e
0x60a4f0: 0xe5 0x74 0xb7 0xc3 0x40 0xc3 0x27 0x83
0x60a4f8: 0x3a 0x1d 0xc4 0x6c 0xef 0xa2 0x2f 0xd0
0x60a500: 0xc4 0xf0 0x2e 0xaa 0x85 0xb0 0x82 0xc3
0x60a508: 0x48 0x64 0x39 0x32 0x57 0x7a 0x45 0x6a
0x60a510: 0x58 0xc6 0x82 0x40 0xaa 0x02 0xa3 0xea
0x60a518: 0xdd 0xbb 0x58 0x3d 0x54 0x8d 0x2a 0xd5
0x60a520: 0x66 0xc8 0xc1 0x7b 0x89 0x83 0x06 0xe0
0x60a528: 0xaf 0x3d 0x56 0x00 0x4b 0x40 0x06 0x4c
0x60a530: 0xb1 0x25 0x74 0xcb 0x0e 0x5a 0x9b 0x70
0x60a538: 0xaa 0x9d 0x68 0x8d 0xaf 0x0e 0xf1 0xe7
0x60a540: 0x6e 0x6b 0x4f 0xc4 0x60 0x48 0x88 0x97
0x60a548: 0x3f 0xc6 0x47 0xe7 0xf3 0xdb 0xb3 0x8e
0x60a550: 0x36 0xad 0x21 0x55 0x40 0x49 0x40 0x08
0x60a558: 0x0c 0x00 0x00 0x0d 0x60 0x00 0x00 0x00
0x60a560: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x1c
VIDEO 0x15-0x7F ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved
1110 xxxx ITU-T Rec. H.262 | ISO/IEC 13818-2 or ISO/IEC 11172-2 or ISO/IEC 14496-2 video stream number xxxx
(gdb) p /x pkt.payload[0].pmt[0].at(0)[0]
$54 = {stream_type = 0x1b, elementary_PID = 0x100}
========================================================================
(gdb) p msg[0]
$6 = {_vptr.TSMessage = 0x407b70, pid = 256, type = TSPidTypeVideo, stream_type = TSStreamTypeVideoH264,
PES_packet_length = 35808, stream_id = 224 '\340', packet_start_code_prefix = 1, packet_header_size = 13,
parsed_packet_size = 35795, packet_data_size = 35795, packet_data = 0x60b300 ""}
(gdb) x /356xb msg->packet_data
========================================================================
TS(H264) header
0x00 0x00 0x00 0x01
0x09 0xf0
0x00 0x00 0x00 0x01
========================================================================
FLV(H264) header
0x00 0x00 0x00 0x00 0x01 0x64 0x00 0x28
0xff 0xe1 0x00 0x1e
========================================================================
H264 Sequence header [section 0]
0x67 0x64 0x00 0x28 0xac 0xd1
0x60b310: 0xc0 0x50 0x05 0xbb 0xff 0x00 0x2d 0x00
0x60b318: 0x22 0x10 0x00 0x00 0x03 0x00 0x10 0x00
0x60b320: 0x00 0x03 0x03 0x08 0xf1 0x83 0x11 0xe0
========================================================================
TS(H264) header
0x00 0x00 0x00 0x01
========================================================================
H264 Sequence header [section 1]
0x68 0xe9 0xab 0x2c 0x8b
========================================================================
TS(H264) header, xbytes
0x00 0x00 0x01
========================================================================
FLV(H264) header, xbytes
0x01 0x00 0x00 0x2a 0x00 0x00 0x00 0x02
0x09 0xf0 0x00 0x00 0x00 0x1e
H264 Sequence header [section 0]
0x67 0x64 0x00 0x28 0xac 0xd1
0xc0 0x50 0x05 0xbb 0xff 0x00 0x2d 0x00
0x22 0x10 0x00 0x00 0x03 0x00 0x10 0x00
0x00 0x03 0x03 0x08 0xf1 0x83 0x11 0xe0
FLV header?
0x00 0x00 0x00 0x05
H264 Sequence header [section 1]
0x68 0xe9 0xab 0x2c 0x8b
FLV header?
0x00 0x00 0x8b 0x9f
========================================================================
0x65 0x88 0x84 0x00
0x60b338: 0x42 0xbf 0x4e 0x19 0x2a 0x00 0x0b 0xa7
0x60b340: 0xeb 0x07 0xb7 0xfc 0xc2 0x24 0x8d 0xfa
0x60b348: 0xc0 0xaf 0x2a 0x76 0x53 0xc4 0x2d 0x80
0x60b350: 0x8f 0xc8 0xba 0x2e 0x2b 0xb7 0x18 0x9f
TS的数据如下:
(gdb) x /35795xb msg->packet_data
0x00 0x00 0x00 0x01
0x09 0xf0
0x00 0x00 0x00 0x01
0x67 0x64 0x00 0x28 0xac 0xd1
0x60b310: 0xc0 0x50 0x05 0xbb 0xff 0x00 0x2d 0x00
0x60b318: 0x22 0x10 0x00 0x00 0x03 0x00 0x10 0x00
0x60b320: 0x00 0x03 0x03 0x08 0xf1 0x83 0x11 0xe0
0x00 0x00 0x00 0x01
0x68 0xe9 0xab 0x2c 0x8b
0x00 0x00 0x01
0x65 0x88 0x84 0x00
0x60b338: 0x42 0xbf 0x4e 0x19 0x2a 0x00 0x0b 0xa7
0x60b340: 0xeb 0x07 0xb7 0xfc 0xc2 0x24 0x8d 0xfa
0x60b348: 0xc0 0xaf 0x2a 0x76 0x53 0xc4 0x2d 0x80
0x60b350: 0x8f 0xc8 0xba 0x2e 0x2b 0xb7 0x18 0x9f
0x60b358: 0xba 0x47 0x10 0x8b 0xc7 0x93 0x92 0x89
0x60b360: 0x00 0x2d 0xdf 0x3b 0xcb 0x51 0xfe 0x27
0x60b368: 0x13 0xe3 0x29 0x48 0x71 0xf7 0x70 0x07
0x60b370: 0xf4 0x5c 0xb4 0xf0 0xbd 0x65 0x76 0xa1
0x60b378: 0x4e 0x96 0xd7 0x2c 0x66 0xdf 0xc3 0x9e
0x60b380: 0xad 0x23 0x4b 0xc3 0xe1 0xf8 0xb4 0x59
0x60b388: 0x24 0x59 0xf3 0x7b 0x8e 0xb0 0xa6 0x95
0x60b390: 0xdf 0x4b 0x05 0x90 0xbd 0x87 0x87 0x99
0x60b398: 0xd5 0xc1 0xb6 0x9f 0x89 0xff 0x2f 0x7d
0x60b3a0: 0xc6 0xac 0x0c 0x8f 0x00 0x07 0x28 0xac
0x60b3a8: 0x09 0xf7 0x87 0xc7 0xc8 0xb6 0x19 0xc3
0x60b3b0: 0xda 0x3b 0x3d 0x9d 0x00 0x5f 0xc7 0xe6
0x60b3b8: 0x39 0xc5 0xc4 0x58 0x76 0xac 0xaa 0x16
0x60b3c0: 0xb7 0x05 0x5d 0xe4 0xe7 0x9d 0xda 0x97
0x60b3c8: 0x1c 0x3c 0xeb 0x66 0xf1 0xd9 0xa8 0x6e
0x60b3d0: 0xae 0xdf 0xbd 0xa9 0x36 0xc9 0x86 0x88
0x60b3d8: 0x54 0x4b 0xb8 0xcc 0xe7 0xa6 0x60 0x40
0x60b3e0: 0x52 0xd9 0x32 0xf4 0xf0 0x2c 0x4f 0xf5
0x60b3e8: 0xc0 0xce 0x74 0x61 0x4a 0xc8 0x65 0x6e
0x60b3f0: 0x92 0x8f 0xc8 0x63 0xd2 0xca 0xcc 0xe1
0x60b3f8: 0x65 0xa6 0x3b 0x6b 0xfd 0x7b 0x66 0x2a
0x60b400: 0x0a 0xea 0x86 0x93 0xce 0x90 0xe7 0x9b
0x60b408: 0x75 0x92 0x0d 0x6f 0xfa 0xa2 0xac 0x26
0x60b410: 0xae 0xb1 0xc3 0x4c 0xab 0x92 0xc6 0xae
TS的第二个视频包数据如下:
(gdb) x /4108xb 0x60b300
0x00 0x00 0x00 0x01
0x09 0xf0
0x00 0x00 0x01
0x41 0x9a 0x28 0xc8 0x4a 0xbf 0xe8
0x60b310: 0x06 0x44 0x30 0x05 0xea 0xd8 0x86 0xa5
0x60b318: 0xee 0x75 0xab 0x30 0xc8 0x7a 0x5c 0xe3
0x60b320: 0xc7 0x4a 0xdb 0xf6 0xe0 0x08 0xbe 0xc4
0x60b328: 0xb0 0xe4 0x5d 0xe7 0x95 0xf3 0x65 0x4e
0x60b330: 0x00 0xed 0xdb 0xd1 0x5e 0xc3 0xb8 0x34
0x60b338: 0x3d 0xd3 0xfe 0x46 0x5b 0xfd 0xd9 0xf0
0x60b340: 0xa0 0x5d 0xa4 0xa8 0x3d 0x44 0x97 0x58
0x60b348: 0x20 0xd5 0x41 0xb2 0x49 0x72 0xd0 0x9b
0x60b350: 0xa2 0xa7 0xbf 0xba 0x9c 0xa8 0x10 0x58
0x60b358: 0x07 0x47 0xf4 0xe5 0xe8 0x5d 0xf2 0x0d
0x60b360: 0xfe 0x51 0x26 0x8a 0x6a 0x76 0xb8 0x35
0x60b368: 0x04 0xfe 0x01 0xb4 0xec 0x67 0xd5 0x1f
0x60b370: 0xb0 0x66 0x0b 0x7e 0x52 0x58 0x38 0x1c
0x60b378: 0xf3 0x4c 0x92 0xe8 0x38 0xc3 0x7e 0x5b
0x60b380: 0xd6 0x17 0x47 0x49 0xba 0xae 0x6e 0xa0
0x60b388: 0xd8 0xfd 0x16 0xdb 0x85 0xd1 0x81 0x6e
0x60b390: 0x43 0x17 0x82 0xb9 0x39 0xb0 0xa8 0xe8
0x60b398: 0x00 0x56 0x52 0x5e 0xfd 0xad 0x5a 0x43
0x60b3a0: 0x32 0x7a 0x4e 0xed 0xd7 0xb2 0x1b 0x4d
0x60b3a8: 0x78 0x9e 0xad 0x4e 0x97 0x37 0x2c 0xbb
0x60b3b0: 0xf3 0x99 0x45 0xee 0xce 0xc7 0x1f 0xeb
0x60b3b8: 0x43 0x37 0xfd 0x67 0x34 0x97 0xcc 0x8c
0x60b3c0: 0xc5 0xec 0x86 0xb0 0x57 0xb4 0x83 0xa9
第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。
\ No newline at end of file
ts+aac+h264+data audio pts:168696991 dts:168696991 size: 286
ts+aac+h264+data audio pts:168701170 dts:168701170 size: 298
ts+aac+h264+data video pts:168704280 dts:168700500 size: 35795
ts+aac+h264+data video pts:168702836 dts:168704280 size: 4108
ts+aac+h264+data video pts:168691586 dts:168691586 size: 425
ts+aac+h264+data video pts:168695366 dts:168695366 size: 466
ts+aac+h264+data video pts:168699146 dts:168699146 size: 353
ts+aac+h264+data video pts:168734250 dts:168702836 size: 4225
ts+aac+h264+data audio pts:168705351 dts:168705351 size: 297
ts+aac+h264+data audio pts:168709530 dts:168709530 size: 297
ts+aac+h264+data audio pts:168713709 dts:168713709 size: 297
ts+aac+h264+data audio pts:168717888 dts:168717888 size: 354
ts+aac+h264+data audio pts:168722067 dts:168722067 size: 366
ts+aac+h264+data video pts:168723000 dts:168723000 size: 416
ts+aac+h264+data video pts:168726780 dts:168726780 size: 486
ts+aac+h264+data video pts:168730470 dts:168730470 size: 408
ts+aac+h264+data video pts:168732896 dts:168734250 size: 5018
ts+aac+h264+data video pts:168738030 dts:168738030 size: 450
ts+aac+h264+data video pts:168725336 dts:168725336 size: 466
ts+aac+h264+data audio pts:168726248 dts:168726248 size: 304
ts+aac+h264+data audio pts:168730427 dts:168730427 size: 282
ts+aac+h264+data audio pts:168734606 dts:168734606 size: 298
ts+aac+h264+data audio pts:168738785 dts:168738785 size: 320
ts+aac+h264+data audio pts:168742964 dts:168742964 size: 293
ts+aac+h264+data video pts:168729116 dts:168729116 size: 384
ts+aac+h264+data video pts:168764220 dts:168732896 size: 6680
ts+aac+h264+data video pts:168736586 dts:168736586 size: 844
ts+aac+h264+data video pts:168756750 dts:168756750 size: 773
ts+aac+h264+data video pts:168760530 dts:168760530 size: 509
ts+aac+h264+data audio pts:168730762 dts:168730762 size: 278
ts+aac+h264+data audio pts:168734941 dts:168734941 size: 277
ts+aac+h264+data audio pts:168739120 dts:168739120 size: 266
ts+aac+h264+data audio pts:168743299 dts:168743299 size: 286
ts+aac+h264+data audio pts:168747478 dts:168747478 size: 276
ts+aac+h264+data video pts:168762866 dts:168764220 size: 7197
ts+aac+h264+data video pts:168768000 dts:168768000 size: 546
ts+aac+h264+data video pts:168755396 dts:168755396 size: 574
ts+aac+h264+data video pts:168759086 dts:168759086 size: 415
ts+aac+h264+data video pts:168794280 dts:168762866 size: 3442
ts+aac+h264+data video pts:168766646 dts:168766646 size: 334
ts+aac+h264+data audio pts:168768044 dts:168768044 size: 284
ts+aac+h264+data audio pts:168772223 dts:168772223 size: 301
ts+aac+h264+data audio pts:168776402 dts:168776402 size: 284
ts+aac+h264+data audio pts:168780581 dts:168780581 size: 287
ts+aac+h264+data audio pts:168784760 dts:168784760 size: 298
ts+aac+h264+data video pts:168770336 dts:168770336 size: 353
ts+aac+h264+data video pts:168790500 dts:168790500 size: 298
ts+aac+h264+data video pts:168792836 dts:168794280 size: 954
ts+aac+h264+data video pts:168797970 dts:168797970 size: 303
ts+aac+h264+data video pts:168801750 dts:168801750 size: 329
ts+aac+h264+data video pts:168789146 dts:168789146 size: 302
ts+aac+h264+data audio pts:168788942 dts:168788942 size: 361
ts+aac+h264+data audio pts:168793121 dts:168793121 size: 309
ts+aac+h264+data audio pts:168797300 dts:168797300 size: 277
ts+aac+h264+data audio pts:168801479 dts:168801479 size: 282
ts+aac+h264+data audio pts:168805658 dts:168805658 size: 284
ts+aac+h264+data video pts:168800396 dts:168792836 size: 746
ts+aac+h264+data video pts:168796616 dts:168796616 size: 473
ts+aac+h264+data video pts:168804086 dts:168800396 size: 3674
ts+aac+h264+data video pts:168824250 dts:168804086 size: 3116
ts+aac+h264+data video pts:168828030 dts:168824250 size: 3064
ts+aac+h264+data audio pts:168793456 dts:168793456 size: 286
ts+aac+h264+data audio pts:168797635 dts:168797635 size: 286
ts+aac+h264+data audio pts:168801814 dts:168801814 size: 303
ts+aac+h264+data audio pts:168805993 dts:168805993 size: 301
ts+aac+h264+data audio pts:168810172 dts:168810172 size: 328
ts+aac+h264+data video pts:168831720 dts:168828030 size: 2899
ts+aac+h264+data video pts:168835500 dts:168831720 size: 3231
ts+aac+h264+data video pts:168822896 dts:168835500 size: 3877
ts+aac+h264+data video pts:168826586 dts:168822896 size: 2984
ts+aac+h264+data video pts:168830366 dts:168826586 size: 6415
ts+aac+h264+data video pts:168834146 dts:168830366 size: 29200
ts+aac+h264+data audio pts:168830738 dts:168830738 size: 290
ts+aac+h264+data audio pts:168834917 dts:168834917 size: 291
ts+aac+h264+data audio pts:168839096 dts:168839096 size: 356
ts+aac+h264+data audio pts:168843275 dts:168843275 size: 317
ts+aac+h264+data audio pts:168847454 dts:168847454 size: 286
ts+aac+h264+data video pts:168854220 dts:168834146 size: 4102
ts+aac+h264+data video pts:168858000 dts:168854220 size: 6944
ts+aac+h264+data video pts:168861780 dts:168858000 size: 9061
ts+aac+h264+data video pts:168865470 dts:168861780 size: 9760
ts+aac+h264+data video pts:168869250 dts:168865470 size: 14741
ts+aac+h264+data audio pts:168835252 dts:168835252 size: 274
ts+aac+h264+data audio pts:168839431 dts:168839431 size: 364
ts+aac+h264+data audio pts:168843610 dts:168843610 size: 317
ts+aac+h264+data audio pts:168847789 dts:168847789 size: 284
ts+aac+h264+data audio pts:168851968 dts:168851968 size: 368
ts+aac+h264+data video pts:168860336 dts:168869250 size: 15711
ts+aac+h264+data video pts:168856646 dts:168856646 size: 2181
ts+aac+h264+data video pts:168891750 dts:168860336 size: 19063
ts+aac+h264+data video pts:168864116 dts:168864116 size: 2345
ts+aac+h264+data video pts:168867896 dts:168867896 size: 2597
ts+aac+h264+data video pts:168887970 dts:168887970 size: 2003
ts+aac+h264+data audio pts:168856150 dts:168856150 size: 357
ts+aac+h264+data audio pts:168860329 dts:168860329 size: 334
ts+aac+h264+data audio pts:168864508 dts:168864508 size: 306
ts+aac+h264+data audio pts:168868687 dts:168868687 size: 290
ts+aac+h264+data audio pts:168872866 dts:168872866 size: 288
ts+aac+h264+data video pts:168890396 dts:168891750 size: 16911
ts+aac+h264+data video pts:168895530 dts:168895530 size: 1196
ts+aac+h264+data video pts:168899220 dts:168899220 size: 1181
ts+aac+h264+data video pts:168886616 dts:168886616 size: 891
ts+aac+h264+data video pts:168921720 dts:168890396 size: 15388
ts+aac+h264+data audio pts:168893432 dts:168893432 size: 285
ts+aac+h264+data audio pts:168897611 dts:168897611 size: 278
ts+aac+h264+data audio pts:168901790 dts:168901790 size: 280
ts+aac+h264+data audio pts:168905969 dts:168905969 size: 276
ts+aac+h264+data audio pts:168910148 dts:168910148 size: 282
ts+aac+h264+data video pts:168894086 dts:168894086 size: 982
ts+aac+h264+data video pts:168897866 dts:168897866 size: 928
ts+aac+h264+data video pts:168901646 dts:168901646 size: 737
ts+aac+h264+data video pts:168920366 dts:168921720 size: 14519
ts+aac+h264+data video pts:168925500 dts:168925500 size: 900
ts+aac+h264+data video pts:168929280 dts:168929280 size: 878
ts+aac+h264+data audio pts:168897946 dts:168897946 size: 282
ts+aac+h264+data audio pts:168902125 dts:168902125 size: 274
ts+aac+h264+data audio pts:168906304 dts:168906304 size: 347
ts+aac+h264+data audio pts:168910483 dts:168910483 size: 341
ts+aac+h264+data audio pts:168914662 dts:168914662 size: 302
ts+aac+h264+data video pts:168932970 dts:168932970 size: 698
ts+aac+h264+data video pts:168935396 dts:168920366 size: 11824
ts+aac+h264+data video pts:168924146 dts:168924146 size: 837
ts+aac+h264+data video pts:168927836 dts:168927836 size: 896
ts+aac+h264+data video pts:168931616 dts:168931616 size: 671
ts+aac+h264+data video pts:168966720 dts:168935396 size: 8523
ts+aac+h264+data audio pts:168935228 dts:168935228 size: 285
ts+aac+h264+data audio pts:168939407 dts:168939407 size: 290
ts+aac+h264+data audio pts:168943586 dts:168943586 size: 301
ts+aac+h264+data audio pts:168947765 dts:168947765 size: 257
ts+aac+h264+data audio pts:168951944 dts:168951944 size: 265
ts+aac+h264+data video pts:168955470 dts:168955470 size: 773
ts+aac+h264+data video pts:168959250 dts:168959250 size: 755
ts+aac+h264+data video pts:168963030 dts:168963030 size: 643
ts+aac+h264+data video pts:168961586 dts:168966720 size: 4648
ts+aac+h264+data video pts:168954116 dts:168954116 size: 626
ts+aac+h264+data audio pts:168956126 dts:168956126 size: 279
ts+aac+h264+data audio pts:168960305 dts:168960305 size: 279
ts+aac+h264+data audio pts:168964484 dts:168964484 size: 280
ts+aac+h264+data audio pts:168968663 dts:168968663 size: 269
ts+aac+h264+data audio pts:168972842 dts:168972842 size: 319
ts+aac+h264+data video pts:168957896 dts:168957896 size: 536
ts+aac+h264+data video pts:168965366 dts:168961586 size: 3771
ts+aac+h264+data video pts:168985530 dts:168965366 size: 4494
ts+aac+h264+data video pts:168989220 dts:168985530 size: 5560
ts+aac+h264+data video pts:168993000 dts:168989220 size: 6541
ts+aac+h264+data video pts:168996780 dts:168993000 size: 7636
ts+aac+h264+data audio pts:168960640 dts:168960640 size: 287
ts+aac+h264+data audio pts:168964819 dts:168964819 size: 279
ts+aac+h264+data audio pts:168968998 dts:168968998 size: 272
ts+aac+h264+data audio pts:168973177 dts:168973177 size: 314
ts+aac+h264+data audio pts:168977356 dts:168977356 size: 318
ts+aac+h264+data video pts:169000470 dts:168996780 size: 6685
ts+aac+h264+data video pts:168987866 dts:169000470 size: 6791
ts+aac+h264+data video pts:168991646 dts:168987866 size: 11730
ts+aac+h264+data video pts:168995336 dts:168991646 size: 14252
ts+aac+h264+data video pts:169022970 dts:168995336 size: 9386
ts+aac+h264+data audio pts:168997922 dts:168997922 size: 269
ts+aac+h264+data audio pts:169002101 dts:169002101 size: 365
ts+aac+h264+data audio pts:169006280 dts:169006280 size: 360
ts+aac+h264+data audio pts:169010459 dts:169010459 size: 339
ts+aac+h264+data audio pts:169014638 dts:169014638 size: 308
ts+aac+h264+data video pts:168999116 dts:168999116 size: 809
ts+aac+h264+data video pts:169019280 dts:169019280 size: 631
ts+aac+h264+data video pts:169030530 dts:169022970 size: 7316
ts+aac+h264+data video pts:169026750 dts:169026750 size: 594
ts+aac+h264+data video pts:169021616 dts:169030530 size: 6070
ts+aac+h264+data video pts:169017836 dts:169017836 size: 674
ts+aac+h264+data audio pts:169018820 dts:169018820 size: 295
ts+aac+h264+data audio pts:169022999 dts:169022999 size: 330
ts+aac+h264+data audio pts:169027178 dts:169027178 size: 291
ts+aac+h264+data audio pts:169031357 dts:169031357 size: 271
ts+aac+h264+data audio pts:169035536 dts:169035536 size: 281
ts+aac+h264+data video pts:169029086 dts:169021616 size: 5808
ts+aac+h264+data video pts:169025396 dts:169025396 size: 958
ts+aac+h264+data video pts:169032866 dts:169029086 size: 5959
ts+aac+h264+data video pts:169053030 dts:169032866 size: 5991
ts+aac+h264+data video pts:169056720 dts:169053030 size: 10941
ts+aac+h264+data audio pts:169023334 dts:169023334 size: 270
ts+aac+h264+data audio pts:169027513 dts:169027513 size: 277
ts+aac+h264+data audio pts:169031692 dts:169031692 size: 264
ts+aac+h264+data audio pts:169035871 dts:169035871 size: 279
ts+aac+h264+data audio pts:169040050 dts:169040050 size: 381
ts+aac+h264+data video pts:169064280 dts:169056720 size: 7867
ts+aac+h264+data video pts:169060500 dts:169060500 size: 4550
ts+aac+h264+data video pts:169051586 dts:169064280 size: 10501
ts+aac+h264+data video pts:169055366 dts:169051586 size: 10772
ts+aac+h264+data video pts:169059146 dts:169055366 size: 12594
ts+aac+h264+data video pts:169083000 dts:169059146 size: 12274
ts+aac+h264+data audio pts:169060616 dts:169060616 size: 362
ts+aac+h264+data audio pts:169064795 dts:169064795 size: 305
ts+aac+h264+data audio pts:169068974 dts:169068974 size: 283
ts+aac+h264+data audio pts:169073153 dts:169073153 size: 285
ts+aac+h264+data audio pts:169077332 dts:169077332 size: 316
ts+aac+h264+data video pts:169062836 dts:169062836 size: 2145
ts+aac+h264+data video pts:169098030 dts:169083000 size: 10764
ts+aac+h264+data video pts:169086780 dts:169086780 size: 952
ts+aac+h264+data video pts:169090470 dts:169090470 size: 977
ts+aac+h264+data video pts:169094250 dts:169094250 size: 830
ts+aac+h264+data video pts:169096586 dts:169098030 size: 2899
ts+aac+h264+data audio pts:169065130 dts:169065130 size: 288
ts+aac+h264+data audio pts:169069309 dts:169069309 size: 313
ts+aac+h264+data audio pts:169073488 dts:169073488 size: 299
ts+aac+h264+data audio pts:169077667 dts:169077667 size: 272
ts+aac+h264+data audio pts:169081846 dts:169081846 size: 285
ts+aac+h264+data video pts:169085336 dts:169085336 size: 388
ts+aac+h264+data video pts:169089116 dts:169089116 size: 291
ts+aac+h264+data video pts:169092896 dts:169092896 size: 275
ts+aac+h264+data video pts:169124220 dts:169096586 size: 676
ts+aac+h264+data video pts:169116750 dts:169116750 size: 249
ts+aac+h264+data audio pts:169086028 dts:169086028 size: 287
ts+aac+h264+data audio pts:169090207 dts:169090207 size: 276
ts+aac+h264+data audio pts:169094386 dts:169094386 size: 272
ts+aac+h264+data audio pts:169098565 dts:169098565 size: 285
ts+aac+h264+data audio pts:169102744 dts:169102744 size: 280
ts+aac+h264+data video pts:169120530 dts:169120530 size: 217
ts+aac+h264+data video pts:169128000 dts:169124220 size: 75644
ts+aac+h264+data video pts:169126646 dts:169128000 size: 2805
ts+aac+h264+data video pts:169131780 dts:169131780 size: 229
ts+aac+h264+data video pts:169119086 dts:169119086 size: 199
ts+aac+h264+data video pts:169122866 dts:169122866 size: 197
ts+aac+h264+data audio pts:169123310 dts:169123310 size: 322
ts+aac+h264+data audio pts:169127489 dts:169127489 size: 384
ts+aac+h264+data audio pts:169131668 dts:169131668 size: 368
ts+aac+h264+data audio pts:169135847 dts:169135847 size: 301
ts+aac+h264+data audio pts:169140026 dts:169140026 size: 308
ts+aac+h264+data video pts:169157970 dts:169126646 size: 4670
ts+aac+h264+data video pts:169130336 dts:169130336 size: 501
ts+aac+h264+data video pts:169150500 dts:169150500 size: 672
ts+aac+h264+data video pts:169154280 dts:169154280 size: 422
ts+aac+h264+data video pts:169156616 dts:169157970 size: 6008
ts+aac+h264+data audio pts:169127824 dts:169127824 size: 309
ts+aac+h264+data audio pts:169132003 dts:169132003 size: 325
ts+aac+h264+data audio pts:169136182 dts:169136182 size: 300
ts+aac+h264+data audio pts:169140361 dts:169140361 size: 266
ts+aac+h264+data audio pts:169144540 dts:169144540 size: 270
ts+aac+h264+data video pts:169161750 dts:169161750 size: 682
ts+aac+h264+data video pts:169149146 dts:169149146 size: 712
ts+aac+h264+data video pts:169152836 dts:169152836 size: 638
ts+aac+h264+data video pts:169188030 dts:169156616 size: 11908
ts+aac+h264+data video pts:169160396 dts:169160396 size: 1508
ts+aac+h264+data video pts:169164086 dts:169164086 size: 1455
ts+aac+h264+data audio pts:169148722 dts:169148722 size: 270
ts+aac+h264+data audio pts:169152901 dts:169152901 size: 268
ts+aac+h264+data audio pts:169157080 dts:169157080 size: 282
ts+aac+h264+data audio pts:169161259 dts:169161259 size: 296
ts+aac+h264+data audio pts:169165438 dts:169165438 size: 267
ts+aac+h264+data video pts:169184250 dts:169184250 size: 1169
ts+aac+h264+data video pts:169186586 dts:169188030 size: 11158
ts+aac+h264+data video pts:169191720 dts:169191720 size: 685
ts+aac+h264+data video pts:169195500 dts:169195500 size: 652
ts+aac+h264+data video pts:169182896 dts:169182896 size: 558
ts+aac+h264+data audio pts:169186004 dts:169186004 size: 278
ts+aac+h264+data audio pts:169190183 dts:169190183 size: 282
ts+aac+h264+data audio pts:169194362 dts:169194362 size: 353
ts+aac+h264+data audio pts:169198541 dts:169198541 size: 346
ts+aac+h264+data audio pts:169202720 dts:169202720 size: 276
ts+aac+h264+data video pts:169218000 dts:169186586 size: 2086
ts+aac+h264+data video pts:169190366 dts:169190366 size: 420
ts+aac+h264+data video pts:169194146 dts:169194146 size: 465
ts+aac+h264+data video pts:169214220 dts:169214220 size: 407
ts+aac+h264+data video pts:169229250 dts:169218000 size: 284
ts+aac+h264+data video pts:169221780 dts:169221780 size: 288
ts+aac+h264+data audio pts:169190518 dts:169190518 size: 275
ts+aac+h264+data audio pts:169194697 dts:169194697 size: 293
ts+aac+h264+data audio pts:169198876 dts:169198876 size: 261
ts+aac+h264+data audio pts:169203055 dts:169203055 size: 295
ts+aac+h264+data audio pts:169207234 dts:169207234 size: 279
ts+aac+h264+data video pts:169225470 dts:169225470 size: 234
ts+aac+h264+data video pts:169216646 dts:169229250 size: 59016
ts+aac+h264+data video pts:169224116 dts:169216646 size: 4100
ts+aac+h264+data video pts:169220336 dts:169220336 size: 1047
ts+aac+h264+data video pts:169247970 dts:169224116 size: 10317
ts+aac+h264+data video pts:169227896 dts:169227896 size: 2748
ts+aac+h264+data audio pts:169227800 dts:169227800 size: 280
ts+aac+h264+data audio pts:169231979 dts:169231979 size: 278
ts+aac+h264+data audio pts:169236158 dts:169236158 size: 361
ts+aac+h264+data audio pts:169240337 dts:169240337 size: 354
ts+aac+h264+data audio pts:169244516 dts:169244516 size: 344
ts+aac+h264+data video pts:169251750 dts:169247970 size: 11029
ts+aac+h264+data video pts:169250396 dts:169251750 size: 4083
ts+aac+h264+data video pts:169255530 dts:169255530 size: 1481
ts+aac+h264+data video pts:169259220 dts:169259220 size: 642
ts+aac+h264+data video pts:169263000 dts:169263000 size: 499
ts+aac+h264+data audio pts:169248697 dts:169248697 size: 321
ts+aac+h264+data audio pts:169252876 dts:169252876 size: 301
ts+aac+h264+data audio pts:169257055 dts:169257055 size: 277
ts+aac+h264+data audio pts:169261234 dts:169261234 size: 318
ts+aac+h264+data audio pts:169265413 dts:169265413 size: 261
ts+aac+h264+data video pts:169281720 dts:169250396 size: 1760
ts+aac+h264+data video pts:169254086 dts:169254086 size: 499
ts+aac+h264+data video pts:169257866 dts:169257866 size: 510
ts+aac+h264+data video pts:169261646 dts:169261646 size: 425
ts+aac+h264+data video pts:169285500 dts:169281720 size: 2071
ts+aac+h264+data video pts:169292970 dts:169285500 size: 4220
ts+aac+h264+data audio pts:169253211 dts:169253211 size: 268
ts+aac+h264+data audio pts:169257390 dts:169257390 size: 289
ts+aac+h264+data audio pts:169261569 dts:169261569 size: 267
ts+aac+h264+data audio pts:169265748 dts:169265748 size: 269
ts+aac+h264+data audio pts:169269927 dts:169269927 size: 280
ts+aac+h264+data video pts:169289280 dts:169289280 size: 2596
ts+aac+h264+data video pts:169280366 dts:169292970 size: 13800
ts+aac+h264+data video pts:169284146 dts:169280366 size: 8452
ts+aac+h264+data video pts:169291616 dts:169284146 size: 11802
ts+aac+h264+data video pts:169287836 dts:169287836 size: 3014
ts+aac+h264+data audio pts:169290493 dts:169290493 size: 263
ts+aac+h264+data audio pts:169294672 dts:169294672 size: 310
ts+aac+h264+data audio pts:169298851 dts:169298851 size: 313
ts+aac+h264+data audio pts:169303030 dts:169303030 size: 331
ts+aac+h264+data audio pts:169307209 dts:169307209 size: 280
ts+aac+h264+data video pts:169295396 dts:169291616 size: 10497
ts+aac+h264+data video pts:169323030 dts:169295396 size: 10094
ts+aac+h264+data video pts:169315470 dts:169315470 size: 1955
ts+aac+h264+data video pts:169319250 dts:169319250 size: 931
ts+aac+h264+data video pts:169321586 dts:169323030 size: 2733
ts+aac+h264+data video pts:169326720 dts:169326720 size: 570
ts+aac+h264+data audio pts:169295007 dts:169295007 size: 330
ts+aac+h264+data audio pts:169299186 dts:169299186 size: 299
ts+aac+h264+data audio pts:169303365 dts:169303365 size: 289
ts+aac+h264+data audio pts:169307544 dts:169307544 size: 296
ts+aac+h264+data audio pts:169311723 dts:169311723 size: 287
ts+aac+h264+data video pts:169314116 dts:169314116 size: 590
ts+aac+h264+data video pts:169317896 dts:169317896 size: 418
ts+aac+h264+data video pts:169349220 dts:169321586 size: 838
ts+aac+h264+data video pts:169325366 dts:169325366 size: 341
ts+aac+h264+data video pts:169345530 dts:169345530 size: 402
ts+aac+h264+data audio pts:169315905 dts:169315905 size: 286
ts+aac+h264+data audio pts:169320084 dts:169320084 size: 278
ts+aac+h264+data audio pts:169324263 dts:169324263 size: 269
ts+aac+h264+data audio pts:169328442 dts:169328442 size: 271
ts+aac+h264+data audio pts:169332621 dts:169332621 size: 276
[mpegts @ 0x22b5040] max_analyze_duration 5000000 reached at 5014800 microseconds
Input #0, mpegts, from 'livestream-1347.ts':
Duration: 00:00:07.25, start: 1874.411011, bitrate: 994 kb/s
Program 1
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 45:34 DAR 40:17], 24 fps, 24 tbr, 90k tbn, 48 tbc
Stream #0:1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 46 kb/s
Stream #0: timebase={num=1, den=90000} type=video
Stream #1: timebase={num=1, den=90000} type=audio
demuxer -> stream audio packet pts=168696991, dts=168696991, size=286, diff=168696991, index=1 dts_time=1874.41
demuxer -> stream audio packet pts=168701170, dts=168701170, size=298, diff=4179, index=1 dts_time=1874.46
demuxer -> stream video packet pts=168704280, dts=168700500, size=35795, diff=168700500, index=0 dts_time=1874.45
demuxer -> stream video packet pts=168719220, dts=168704280, size=4108, diff=3780, index=0 dts_time=1874.49
demuxer -> stream video packet pts=168707970, dts=168707970, size=425, diff=3690, index=0 dts_time=1874.53
demuxer -> stream video packet pts=168711750, dts=168711750, size=466, diff=3780, index=0 dts_time=1874.58
demuxer -> stream video packet pts=168715530, dts=168715530, size=353, diff=3780, index=0 dts_time=1874.62
demuxer -> stream audio packet pts=168705351, dts=168705351, size=297, diff=4181, index=1 dts_time=1874.5
demuxer -> stream audio packet pts=168709530, dts=168709530, size=297, diff=4179, index=1 dts_time=1874.55
demuxer -> stream audio packet pts=168713709, dts=168713709, size=297, diff=4179, index=1 dts_time=1874.6
demuxer -> stream audio packet pts=168717888, dts=168717888, size=354, diff=4179, index=1 dts_time=1874.64
demuxer -> stream audio packet pts=168722067, dts=168722067, size=366, diff=4179, index=1 dts_time=1874.69
demuxer -> stream video packet pts=168734250, dts=168719220, size=4225, diff=3690, index=0 dts_time=1874.66
demuxer -> stream video packet pts=168723000, dts=168723000, size=416, diff=3780, index=0 dts_time=1874.7
demuxer -> stream video packet pts=168726780, dts=168726780, size=486, diff=3780, index=0 dts_time=1874.74
demuxer -> stream video packet pts=168730470, dts=168730470, size=408, diff=3690, index=0 dts_time=1874.78
demuxer -> stream video packet pts=168749280, dts=168734250, size=5018, diff=3780, index=0 dts_time=1874.83
demuxer -> stream video packet pts=168738030, dts=168738030, size=450, diff=3780, index=0 dts_time=1874.87
demuxer -> stream audio packet pts=168726248, dts=168726248, size=304, diff=4181, index=1 dts_time=1874.74
demuxer -> stream audio packet pts=168730427, dts=168730427, size=282, diff=4179, index=1 dts_time=1874.78
demuxer -> stream audio packet pts=168734606, dts=168734606, size=298, diff=4179, index=1 dts_time=1874.83
demuxer -> stream audio packet pts=168738785, dts=168738785, size=320, diff=4179, index=1 dts_time=1874.88
demuxer -> stream audio packet pts=168742964, dts=168742964, size=293, diff=4179, index=1 dts_time=1874.92
demuxer -> stream video packet pts=168741720, dts=168741720, size=466, diff=3690, index=0 dts_time=1874.91
demuxer -> stream video packet pts=168745500, dts=168745500, size=384, diff=3780, index=0 dts_time=1874.95
demuxer -> stream video packet pts=168764220, dts=168749280, size=6680, diff=3780, index=0 dts_time=1874.99
demuxer -> stream video packet pts=168752970, dts=168752970, size=844, diff=3690, index=0 dts_time=1875.03
demuxer -> stream video packet pts=168756750, dts=168756750, size=773, diff=3780, index=0 dts_time=1875.08
demuxer -> stream audio packet pts=168747146, dts=168747146, size=278, diff=4182, index=1 dts_time=1874.97
demuxer -> stream audio packet pts=168751325, dts=168751325, size=277, diff=4179, index=1 dts_time=1875.01
demuxer -> stream audio packet pts=168755504, dts=168755504, size=266, diff=4179, index=1 dts_time=1875.06
demuxer -> stream audio packet pts=168759683, dts=168759683, size=286, diff=4179, index=1 dts_time=1875.11
demuxer -> stream audio packet pts=168763862, dts=168763862, size=276, diff=4179, index=1 dts_time=1875.15
demuxer -> stream video packet pts=168760530, dts=168760530, size=509, diff=3780, index=0 dts_time=1875.12
demuxer -> stream video packet pts=168779250, dts=168764220, size=7197, diff=3690, index=0 dts_time=1875.16
demuxer -> stream video packet pts=168768000, dts=168768000, size=546, diff=3780, index=0 dts_time=1875.2
demuxer -> stream video packet pts=168771780, dts=168771780, size=574, diff=3780, index=0 dts_time=1875.24
demuxer -> stream video packet pts=168775470, dts=168775470, size=415, diff=3690, index=0 dts_time=1875.28
demuxer -> stream video packet pts=168794280, dts=168779250, size=3442, diff=3780, index=0 dts_time=1875.33
demuxer -> stream audio packet pts=168768044, dts=168768044, size=284, diff=4182, index=1 dts_time=1875.2
demuxer -> stream audio packet pts=168772223, dts=168772223, size=301, diff=4179, index=1 dts_time=1875.25
demuxer -> stream audio packet pts=168776402, dts=168776402, size=284, diff=4179, index=1 dts_time=1875.29
demuxer -> stream audio packet pts=168780581, dts=168780581, size=287, diff=4179, index=1 dts_time=1875.34
demuxer -> stream audio packet pts=168784760, dts=168784760, size=298, diff=4179, index=1 dts_time=1875.39
demuxer -> stream video packet pts=168783030, dts=168783030, size=334, diff=3780, index=0 dts_time=1875.37
demuxer -> stream video packet pts=168786720, dts=168786720, size=353, diff=3690, index=0 dts_time=1875.41
demuxer -> stream video packet pts=168790500, dts=168790500, size=298, diff=3780, index=0 dts_time=1875.45
demuxer -> stream video packet pts=168809220, dts=168794280, size=954, diff=3780, index=0 dts_time=1875.49
demuxer -> stream video packet pts=168797970, dts=168797970, size=303, diff=3690, index=0 dts_time=1875.53
demuxer -> stream video packet pts=168801750, dts=168801750, size=329, diff=3780, index=0 dts_time=1875.58
demuxer -> stream audio packet pts=168788942, dts=168788942, size=361, diff=4182, index=1 dts_time=1875.43
demuxer -> stream audio packet pts=168793121, dts=168793121, size=309, diff=4179, index=1 dts_time=1875.48
demuxer -> stream audio packet pts=168797300, dts=168797300, size=277, diff=4179, index=1 dts_time=1875.53
demuxer -> stream audio packet pts=168801479, dts=168801479, size=282, diff=4179, index=1 dts_time=1875.57
demuxer -> stream audio packet pts=168805658, dts=168805658, size=284, diff=4179, index=1 dts_time=1875.62
demuxer -> stream video packet pts=168805530, dts=168805530, size=302, diff=3780, index=0 dts_time=1875.62
demuxer -> stream video packet pts=168816780, dts=168809220, size=746, diff=3690, index=0 dts_time=1875.66
demuxer -> stream video packet pts=168813000, dts=168813000, size=473, diff=3780, index=0 dts_time=1875.7
demuxer -> stream video packet pts=168820470, dts=168816780, size=3674, diff=3780, index=0 dts_time=1875.74
demuxer -> stream video packet pts=168824250, dts=168820470, size=3116, diff=3690, index=0 dts_time=1875.78
demuxer -> stream audio packet pts=168809840, dts=168809840, size=286, diff=4182, index=1 dts_time=1875.66
demuxer -> stream audio packet pts=168814019, dts=168814019, size=286, diff=4179, index=1 dts_time=1875.71
demuxer -> stream audio packet pts=168818198, dts=168818198, size=303, diff=4179, index=1 dts_time=1875.76
demuxer -> stream audio packet pts=168822377, dts=168822377, size=301, diff=4179, index=1 dts_time=1875.8
demuxer -> stream audio packet pts=168826556, dts=168826556, size=328, diff=4179, index=1 dts_time=1875.85
demuxer -> stream video packet pts=168828030, dts=168824250, size=3064, diff=3780, index=0 dts_time=1875.83
demuxer -> stream video packet pts=168831720, dts=168828030, size=2899, diff=3780, index=0 dts_time=1875.87
demuxer -> stream video packet pts=168835500, dts=168831720, size=3231, diff=3690, index=0 dts_time=1875.91
demuxer -> stream video packet pts=168839280, dts=168835500, size=3877, diff=3780, index=0 dts_time=1875.95
demuxer -> stream video packet pts=168842970, dts=168839280, size=2984, diff=3780, index=0 dts_time=1875.99
demuxer -> stream video packet pts=168846750, dts=168842970, size=6415, diff=3690, index=0 dts_time=1876.03
demuxer -> stream audio packet pts=168830738, dts=168830738, size=290, diff=4182, index=1 dts_time=1875.9
demuxer -> stream audio packet pts=168834917, dts=168834917, size=291, diff=4179, index=1 dts_time=1875.94
demuxer -> stream audio packet pts=168839096, dts=168839096, size=356, diff=4179, index=1 dts_time=1875.99
demuxer -> stream audio packet pts=168843275, dts=168843275, size=317, diff=4179, index=1 dts_time=1876.04
demuxer -> stream audio packet pts=168847454, dts=168847454, size=286, diff=4179, index=1 dts_time=1876.08
demuxer -> stream video packet pts=168850530, dts=168846750, size=29200, diff=3780, index=0 dts_time=1876.08
demuxer -> stream video packet pts=168854220, dts=168850530, size=4102, diff=3780, index=0 dts_time=1876.12
demuxer -> stream video packet pts=168858000, dts=168854220, size=6944, diff=3690, index=0 dts_time=1876.16
demuxer -> stream video packet pts=168861780, dts=168858000, size=9061, diff=3780, index=0 dts_time=1876.2
demuxer -> stream video packet pts=168865470, dts=168861780, size=9760, diff=3780, index=0 dts_time=1876.24
demuxer -> stream audio packet pts=168851636, dts=168851636, size=274, diff=4182, index=1 dts_time=1876.13
demuxer -> stream audio packet pts=168855815, dts=168855815, size=364, diff=4179, index=1 dts_time=1876.18
demuxer -> stream audio packet pts=168859994, dts=168859994, size=317, diff=4179, index=1 dts_time=1876.22
demuxer -> stream audio packet pts=168864173, dts=168864173, size=284, diff=4179, index=1 dts_time=1876.27
demuxer -> stream audio packet pts=168868352, dts=168868352, size=368, diff=4179, index=1 dts_time=1876.32
demuxer -> stream video packet pts=168869250, dts=168865470, size=14741, diff=3690, index=0 dts_time=1876.28
demuxer -> stream video packet pts=168876720, dts=168869250, size=15711, diff=3780, index=0 dts_time=1876.33
demuxer -> stream video packet pts=168873030, dts=168873030, size=2181, diff=3780, index=0 dts_time=1876.37
demuxer -> stream video packet pts=168891750, dts=168876720, size=19063, diff=3690, index=0 dts_time=1876.41
demuxer -> stream video packet pts=168880500, dts=168880500, size=2345, diff=3780, index=0 dts_time=1876.45
demuxer -> stream video packet pts=168884280, dts=168884280, size=2597, diff=3780, index=0 dts_time=1876.49
demuxer -> stream audio packet pts=168872534, dts=168872534, size=357, diff=4182, index=1 dts_time=1876.36
demuxer -> stream audio packet pts=168876713, dts=168876713, size=334, diff=4179, index=1 dts_time=1876.41
demuxer -> stream audio packet pts=168880892, dts=168880892, size=306, diff=4179, index=1 dts_time=1876.45
demuxer -> stream audio packet pts=168885071, dts=168885071, size=290, diff=4179, index=1 dts_time=1876.5
demuxer -> stream audio packet pts=168889250, dts=168889250, size=288, diff=4179, index=1 dts_time=1876.55
demuxer -> stream video packet pts=168887970, dts=168887970, size=2003, diff=3690, index=0 dts_time=1876.53
demuxer -> stream video packet pts=168906780, dts=168891750, size=16911, diff=3780, index=0 dts_time=1876.58
demuxer -> stream video packet pts=168895530, dts=168895530, size=1196, diff=3780, index=0 dts_time=1876.62
demuxer -> stream video packet pts=168899220, dts=168899220, size=1181, diff=3690, index=0 dts_time=1876.66
demuxer -> stream video packet pts=168903000, dts=168903000, size=891, diff=3780, index=0 dts_time=1876.7
demuxer -> stream audio packet pts=168893432, dts=168893432, size=285, diff=4182, index=1 dts_time=1876.59
demuxer -> stream audio packet pts=168897611, dts=168897611, size=278, diff=4179, index=1 dts_time=1876.64
demuxer -> stream audio packet pts=168901790, dts=168901790, size=280, diff=4179, index=1 dts_time=1876.69
demuxer -> stream audio packet pts=168905969, dts=168905969, size=276, diff=4179, index=1 dts_time=1876.73
demuxer -> stream audio packet pts=168910148, dts=168910148, size=282, diff=4179, index=1 dts_time=1876.78
demuxer -> stream video packet pts=168921720, dts=168906780, size=15388, diff=3780, index=0 dts_time=1876.74
demuxer -> stream video packet pts=168910470, dts=168910470, size=982, diff=3690, index=0 dts_time=1876.78
demuxer -> stream video packet pts=168914250, dts=168914250, size=928, diff=3780, index=0 dts_time=1876.83
demuxer -> stream video packet pts=168918030, dts=168918030, size=737, diff=3780, index=0 dts_time=1876.87
demuxer -> stream video packet pts=168936750, dts=168921720, size=14519, diff=3690, index=0 dts_time=1876.91
demuxer -> stream video packet pts=168925500, dts=168925500, size=900, diff=3780, index=0 dts_time=1876.95
demuxer -> stream audio packet pts=168914330, dts=168914330, size=282, diff=4182, index=1 dts_time=1876.83
demuxer -> stream audio packet pts=168918509, dts=168918509, size=274, diff=4179, index=1 dts_time=1876.87
demuxer -> stream audio packet pts=168922688, dts=168922688, size=347, diff=4179, index=1 dts_time=1876.92
demuxer -> stream audio packet pts=168926867, dts=168926867, size=341, diff=4179, index=1 dts_time=1876.97
demuxer -> stream audio packet pts=168931046, dts=168931046, size=302, diff=4179, index=1 dts_time=1877.01
demuxer -> stream video packet pts=168929280, dts=168929280, size=878, diff=3780, index=0 dts_time=1876.99
demuxer -> stream video packet pts=168932970, dts=168932970, size=698, diff=3690, index=0 dts_time=1877.03
demuxer -> stream video packet pts=168951780, dts=168936750, size=11824, diff=3780, index=0 dts_time=1877.08
demuxer -> stream video packet pts=168940530, dts=168940530, size=837, diff=3780, index=0 dts_time=1877.12
demuxer -> stream video packet pts=168944220, dts=168944220, size=896, diff=3690, index=0 dts_time=1877.16
demuxer -> stream video packet pts=168948000, dts=168948000, size=671, diff=3780, index=0 dts_time=1877.2
demuxer -> stream audio packet pts=168935228, dts=168935228, size=285, diff=4182, index=1 dts_time=1877.06
demuxer -> stream audio packet pts=168939407, dts=168939407, size=290, diff=4179, index=1 dts_time=1877.1
demuxer -> stream audio packet pts=168943586, dts=168943586, size=301, diff=4179, index=1 dts_time=1877.15
demuxer -> stream audio packet pts=168947765, dts=168947765, size=257, diff=4179, index=1 dts_time=1877.2
demuxer -> stream audio packet pts=168951944, dts=168951944, size=265, diff=4179, index=1 dts_time=1877.24
demuxer -> stream video packet pts=168966720, dts=168951780, size=8523, diff=3780, index=0 dts_time=1877.24
demuxer -> stream video packet pts=168955470, dts=168955470, size=773, diff=3690, index=0 dts_time=1877.28
demuxer -> stream video packet pts=168959250, dts=168959250, size=755, diff=3780, index=0 dts_time=1877.33
demuxer -> stream video packet pts=168963030, dts=168963030, size=643, diff=3780, index=0 dts_time=1877.37
demuxer -> stream video packet pts=168977970, dts=168966720, size=4648, diff=3690, index=0 dts_time=1877.41
demuxer -> stream audio packet pts=168956126, dts=168956126, size=279, diff=4182, index=1 dts_time=1877.29
demuxer -> stream audio packet pts=168960305, dts=168960305, size=279, diff=4179, index=1 dts_time=1877.34
demuxer -> stream audio packet pts=168964484, dts=168964484, size=280, diff=4179, index=1 dts_time=1877.38
demuxer -> stream audio packet pts=168968663, dts=168968663, size=269, diff=4179, index=1 dts_time=1877.43
demuxer -> stream audio packet pts=168972842, dts=168972842, size=319, diff=4179, index=1 dts_time=1877.48
demuxer -> stream video packet pts=168970500, dts=168970500, size=626, diff=3780, index=0 dts_time=1877.45
demuxer -> stream video packet pts=168974280, dts=168974280, size=536, diff=3780, index=0 dts_time=1877.49
demuxer -> stream video packet pts=168981750, dts=168977970, size=3771, diff=3690, index=0 dts_time=1877.53
demuxer -> stream video packet pts=168985530, dts=168981750, size=4494, diff=3780, index=0 dts_time=1877.58
demuxer -> stream video packet pts=168989220, dts=168985530, size=5560, diff=3780, index=0 dts_time=1877.62
demuxer -> stream video packet pts=168993000, dts=168989220, size=6541, diff=3690, index=0 dts_time=1877.66
demuxer -> stream audio packet pts=168977024, dts=168977024, size=287, diff=4182, index=1 dts_time=1877.52
demuxer -> stream audio packet pts=168981203, dts=168981203, size=279, diff=4179, index=1 dts_time=1877.57
demuxer -> stream audio packet pts=168985382, dts=168985382, size=272, diff=4179, index=1 dts_time=1877.62
demuxer -> stream audio packet pts=168989561, dts=168989561, size=314, diff=4179, index=1 dts_time=1877.66
demuxer -> stream audio packet pts=168993740, dts=168993740, size=318, diff=4179, index=1 dts_time=1877.71
demuxer -> stream video packet pts=168996780, dts=168993000, size=7636, diff=3780, index=0 dts_time=1877.7
demuxer -> stream video packet pts=169000470, dts=168996780, size=6685, diff=3780, index=0 dts_time=1877.74
demuxer -> stream video packet pts=169004250, dts=169000470, size=6791, diff=3690, index=0 dts_time=1877.78
demuxer -> stream video packet pts=169008030, dts=169004250, size=11730, diff=3780, index=0 dts_time=1877.83
demuxer -> stream video packet pts=169011720, dts=169008030, size=14252, diff=3780, index=0 dts_time=1877.87
demuxer -> stream audio packet pts=168997922, dts=168997922, size=269, diff=4182, index=1 dts_time=1877.75
demuxer -> stream audio packet pts=169002101, dts=169002101, size=365, diff=4179, index=1 dts_time=1877.8
demuxer -> stream audio packet pts=169006280, dts=169006280, size=360, diff=4179, index=1 dts_time=1877.85
demuxer -> stream audio packet pts=169010459, dts=169010459, size=339, diff=4179, index=1 dts_time=1877.89
demuxer -> stream audio packet pts=169014638, dts=169014638, size=308, diff=4179, index=1 dts_time=1877.94
demuxer -> stream video packet pts=169022970, dts=169011720, size=9386, diff=3690, index=0 dts_time=1877.91
demuxer -> stream video packet pts=169015500, dts=169015500, size=809, diff=3780, index=0 dts_time=1877.95
demuxer -> stream video packet pts=169019280, dts=169019280, size=631, diff=3780, index=0 dts_time=1877.99
demuxer -> stream video packet pts=169030530, dts=169022970, size=7316, diff=3690, index=0 dts_time=1878.03
demuxer -> stream video packet pts=169026750, dts=169026750, size=594, diff=3780, index=0 dts_time=1878.08
demuxer -> stream video packet pts=169038000, dts=169030530, size=6070, diff=3780, index=0 dts_time=1878.12
demuxer -> stream audio packet pts=169018820, dts=169018820, size=295, diff=4182, index=1 dts_time=1877.99
demuxer -> stream audio packet pts=169022999, dts=169022999, size=330, diff=4179, index=1 dts_time=1878.03
demuxer -> stream audio packet pts=169027178, dts=169027178, size=291, diff=4179, index=1 dts_time=1878.08
demuxer -> stream audio packet pts=169031357, dts=169031357, size=271, diff=4179, index=1 dts_time=1878.13
demuxer -> stream audio packet pts=169035536, dts=169035536, size=281, diff=4179, index=1 dts_time=1878.17
demuxer -> stream video packet pts=169034220, dts=169034220, size=674, diff=3690, index=0 dts_time=1878.16
demuxer -> stream video packet pts=169045470, dts=169038000, size=5808, diff=3780, index=0 dts_time=1878.2
demuxer -> stream video packet pts=169041780, dts=169041780, size=958, diff=3780, index=0 dts_time=1878.24
demuxer -> stream video packet pts=169049250, dts=169045470, size=5959, diff=3690, index=0 dts_time=1878.28
demuxer -> stream video packet pts=169053030, dts=169049250, size=5991, diff=3780, index=0 dts_time=1878.33
demuxer -> stream audio packet pts=169039718, dts=169039718, size=270, diff=4182, index=1 dts_time=1878.22
demuxer -> stream audio packet pts=169043897, dts=169043897, size=277, diff=4179, index=1 dts_time=1878.27
demuxer -> stream audio packet pts=169048076, dts=169048076, size=264, diff=4179, index=1 dts_time=1878.31
demuxer -> stream audio packet pts=169052255, dts=169052255, size=279, diff=4179, index=1 dts_time=1878.36
demuxer -> stream audio packet pts=169056434, dts=169056434, size=381, diff=4179, index=1 dts_time=1878.4
demuxer -> stream video packet pts=169056720, dts=169053030, size=10941, diff=3780, index=0 dts_time=1878.37
demuxer -> stream video packet pts=169064280, dts=169056720, size=7867, diff=3690, index=0 dts_time=1878.41
demuxer -> stream video packet pts=169060500, dts=169060500, size=4550, diff=3780, index=0 dts_time=1878.45
demuxer -> stream video packet pts=169067970, dts=169064280, size=10501, diff=3780, index=0 dts_time=1878.49
demuxer -> stream video packet pts=169071750, dts=169067970, size=10772, diff=3690, index=0 dts_time=1878.53
demuxer -> stream video packet pts=169075530, dts=169071750, size=12594, diff=3780, index=0 dts_time=1878.58
demuxer -> stream audio packet pts=169060616, dts=169060616, size=362, diff=4182, index=1 dts_time=1878.45
demuxer -> stream audio packet pts=169064795, dts=169064795, size=305, diff=4179, index=1 dts_time=1878.5
demuxer -> stream audio packet pts=169068974, dts=169068974, size=283, diff=4179, index=1 dts_time=1878.54
demuxer -> stream audio packet pts=169073153, dts=169073153, size=285, diff=4179, index=1 dts_time=1878.59
demuxer -> stream audio packet pts=169077332, dts=169077332, size=316, diff=4179, index=1 dts_time=1878.64
demuxer -> stream video packet pts=169083000, dts=169075530, size=12274, diff=3780, index=0 dts_time=1878.62
demuxer -> stream video packet pts=169079220, dts=169079220, size=2145, diff=3690, index=0 dts_time=1878.66
demuxer -> stream video packet pts=169098030, dts=169083000, size=10764, diff=3780, index=0 dts_time=1878.7
demuxer -> stream video packet pts=169086780, dts=169086780, size=952, diff=3780, index=0 dts_time=1878.74
demuxer -> stream video packet pts=169090470, dts=169090470, size=977, diff=3690, index=0 dts_time=1878.78
demuxer -> stream video packet pts=169094250, dts=169094250, size=830, diff=3780, index=0 dts_time=1878.83
demuxer -> stream audio packet pts=169081514, dts=169081514, size=288, diff=4182, index=1 dts_time=1878.68
demuxer -> stream audio packet pts=169085693, dts=169085693, size=313, diff=4179, index=1 dts_time=1878.73
demuxer -> stream audio packet pts=169089872, dts=169089872, size=299, diff=4179, index=1 dts_time=1878.78
demuxer -> stream audio packet pts=169094051, dts=169094051, size=272, diff=4179, index=1 dts_time=1878.82
demuxer -> stream audio packet pts=169098230, dts=169098230, size=285, diff=4179, index=1 dts_time=1878.87
demuxer -> stream video packet pts=169112970, dts=169098030, size=2899, diff=3780, index=0 dts_time=1878.87
demuxer -> stream video packet pts=169101720, dts=169101720, size=388, diff=3690, index=0 dts_time=1878.91
demuxer -> stream video packet pts=169105500, dts=169105500, size=291, diff=3780, index=0 dts_time=1878.95
demuxer -> stream video packet pts=169109280, dts=169109280, size=275, diff=3780, index=0 dts_time=1878.99
demuxer -> stream video packet pts=169124220, dts=169112970, size=676, diff=3690, index=0 dts_time=1879.03
demuxer -> stream audio packet pts=169102412, dts=169102412, size=287, diff=4182, index=1 dts_time=1878.92
demuxer -> stream audio packet pts=169106591, dts=169106591, size=276, diff=4179, index=1 dts_time=1878.96
demuxer -> stream audio packet pts=169110770, dts=169110770, size=272, diff=4179, index=1 dts_time=1879.01
demuxer -> stream audio packet pts=169114949, dts=169114949, size=285, diff=4179, index=1 dts_time=1879.05
demuxer -> stream audio packet pts=169119128, dts=169119128, size=280, diff=4179, index=1 dts_time=1879.1
demuxer -> stream video packet pts=169116750, dts=169116750, size=249, diff=3780, index=0 dts_time=1879.08
demuxer -> stream video packet pts=169120530, dts=169120530, size=217, diff=3780, index=0 dts_time=1879.12
demuxer -> stream video packet pts=169128000, dts=169124220, size=75657, diff=3690, index=0 dts_time=1879.16
demuxer -> stream video packet pts=169143030, dts=169128000, size=2805, diff=3780, index=0 dts_time=1879.2
demuxer -> stream video packet pts=169131780, dts=169131780, size=229, diff=3780, index=0 dts_time=1879.24
demuxer -> stream video packet pts=169135470, dts=169135470, size=199, diff=3690, index=0 dts_time=1879.28
demuxer -> stream audio packet pts=169123310, dts=169123310, size=322, diff=4182, index=1 dts_time=1879.15
demuxer -> stream audio packet pts=169127489, dts=169127489, size=384, diff=4179, index=1 dts_time=1879.19
demuxer -> stream audio packet pts=169131668, dts=169131668, size=368, diff=4179, index=1 dts_time=1879.24
demuxer -> stream audio packet pts=169135847, dts=169135847, size=301, diff=4179, index=1 dts_time=1879.29
demuxer -> stream audio packet pts=169140026, dts=169140026, size=308, diff=4179, index=1 dts_time=1879.33
demuxer -> stream video packet pts=169139250, dts=169139250, size=197, diff=3780, index=0 dts_time=1879.33
demuxer -> stream video packet pts=169157970, dts=169143030, size=4670, diff=3780, index=0 dts_time=1879.37
demuxer -> stream video packet pts=169146720, dts=169146720, size=501, diff=3690, index=0 dts_time=1879.41
demuxer -> stream video packet pts=169150500, dts=169150500, size=672, diff=3780, index=0 dts_time=1879.45
demuxer -> stream video packet pts=169154280, dts=169154280, size=422, diff=3780, index=0 dts_time=1879.49
demuxer -> stream audio packet pts=169144208, dts=169144208, size=309, diff=4182, index=1 dts_time=1879.38
demuxer -> stream audio packet pts=169148387, dts=169148387, size=325, diff=4179, index=1 dts_time=1879.43
demuxer -> stream audio packet pts=169152566, dts=169152566, size=300, diff=4179, index=1 dts_time=1879.47
demuxer -> stream audio packet pts=169156745, dts=169156745, size=266, diff=4179, index=1 dts_time=1879.52
demuxer -> stream audio packet pts=169160924, dts=169160924, size=270, diff=4179, index=1 dts_time=1879.57
demuxer -> stream video packet pts=169173000, dts=169157970, size=6008, diff=3690, index=0 dts_time=1879.53
demuxer -> stream video packet pts=169161750, dts=169161750, size=682, diff=3780, index=0 dts_time=1879.58
demuxer -> stream video packet pts=169165530, dts=169165530, size=712, diff=3780, index=0 dts_time=1879.62
demuxer -> stream video packet pts=169169220, dts=169169220, size=638, diff=3690, index=0 dts_time=1879.66
demuxer -> stream video packet pts=169188030, dts=169173000, size=11908, diff=3780, index=0 dts_time=1879.7
demuxer -> stream video packet pts=169176780, dts=169176780, size=1508, diff=3780, index=0 dts_time=1879.74
demuxer -> stream audio packet pts=169165106, dts=169165106, size=270, diff=4182, index=1 dts_time=1879.61
demuxer -> stream audio packet pts=169169285, dts=169169285, size=268, diff=4179, index=1 dts_time=1879.66
demuxer -> stream audio packet pts=169173464, dts=169173464, size=282, diff=4179, index=1 dts_time=1879.71
demuxer -> stream audio packet pts=169177643, dts=169177643, size=296, diff=4179, index=1 dts_time=1879.75
demuxer -> stream audio packet pts=169181822, dts=169181822, size=267, diff=4179, index=1 dts_time=1879.8
demuxer -> stream video packet pts=169180470, dts=169180470, size=1455, diff=3690, index=0 dts_time=1879.78
demuxer -> stream video packet pts=169184250, dts=169184250, size=1169, diff=3780, index=0 dts_time=1879.83
demuxer -> stream video packet pts=169202970, dts=169188030, size=11158, diff=3780, index=0 dts_time=1879.87
demuxer -> stream video packet pts=169191720, dts=169191720, size=685, diff=3690, index=0 dts_time=1879.91
demuxer -> stream video packet pts=169195500, dts=169195500, size=652, diff=3780, index=0 dts_time=1879.95
demuxer -> stream audio packet pts=169186004, dts=169186004, size=278, diff=4182, index=1 dts_time=1879.84
demuxer -> stream audio packet pts=169190183, dts=169190183, size=282, diff=4179, index=1 dts_time=1879.89
demuxer -> stream audio packet pts=169194362, dts=169194362, size=353, diff=4179, index=1 dts_time=1879.94
demuxer -> stream audio packet pts=169198541, dts=169198541, size=346, diff=4179, index=1 dts_time=1879.98
demuxer -> stream audio packet pts=169202720, dts=169202720, size=276, diff=4179, index=1 dts_time=1880.03
demuxer -> stream video packet pts=169199280, dts=169199280, size=558, diff=3780, index=0 dts_time=1879.99
demuxer -> stream video packet pts=169218000, dts=169202970, size=2086, diff=3690, index=0 dts_time=1880.03
demuxer -> stream video packet pts=169206750, dts=169206750, size=420, diff=3780, index=0 dts_time=1880.08
demuxer -> stream video packet pts=169210530, dts=169210530, size=465, diff=3780, index=0 dts_time=1880.12
demuxer -> stream video packet pts=169214220, dts=169214220, size=407, diff=3690, index=0 dts_time=1880.16
demuxer -> stream video packet pts=169229250, dts=169218000, size=284, diff=3780, index=0 dts_time=1880.2
demuxer -> stream audio packet pts=169206902, dts=169206902, size=275, diff=4182, index=1 dts_time=1880.08
demuxer -> stream audio packet pts=169211081, dts=169211081, size=293, diff=4179, index=1 dts_time=1880.12
demuxer -> stream audio packet pts=169215260, dts=169215260, size=261, diff=4179, index=1 dts_time=1880.17
demuxer -> stream audio packet pts=169219439, dts=169219439, size=295, diff=4179, index=1 dts_time=1880.22
demuxer -> stream audio packet pts=169223618, dts=169223618, size=279, diff=4179, index=1 dts_time=1880.26
demuxer -> stream video packet pts=169221780, dts=169221780, size=288, diff=3780, index=0 dts_time=1880.24
demuxer -> stream video packet pts=169225470, dts=169225470, size=234, diff=3690, index=0 dts_time=1880.28
demuxer -> stream video packet pts=169233030, dts=169229250, size=59016, diff=3780, index=0 dts_time=1880.33
demuxer -> stream video packet pts=169240500, dts=169233030, size=4100, diff=3780, index=0 dts_time=1880.37
demuxer -> stream video packet pts=169236720, dts=169236720, size=1047, diff=3690, index=0 dts_time=1880.41
demuxer -> stream video packet pts=169247970, dts=169240500, size=10317, diff=3780, index=0 dts_time=1880.45
demuxer -> stream audio packet pts=169227800, dts=169227800, size=280, diff=4182, index=1 dts_time=1880.31
demuxer -> stream audio packet pts=169231979, dts=169231979, size=278, diff=4179, index=1 dts_time=1880.36
demuxer -> stream audio packet pts=169236158, dts=169236158, size=361, diff=4179, index=1 dts_time=1880.4
demuxer -> stream audio packet pts=169240337, dts=169240337, size=354, diff=4179, index=1 dts_time=1880.45
demuxer -> stream audio packet pts=169244516, dts=169244516, size=344, diff=4179, index=1 dts_time=1880.49
demuxer -> stream video packet pts=169244280, dts=169244280, size=2748, diff=3780, index=0 dts_time=1880.49
demuxer -> stream video packet pts=169251750, dts=169247970, size=11029, diff=3690, index=0 dts_time=1880.53
demuxer -> stream video packet pts=169266780, dts=169251750, size=4083, diff=3780, index=0 dts_time=1880.58
demuxer -> stream video packet pts=169255530, dts=169255530, size=1481, diff=3780, index=0 dts_time=1880.62
demuxer -> stream video packet pts=169259220, dts=169259220, size=642, diff=3690, index=0 dts_time=1880.66
demuxer -> stream audio packet pts=169248697, dts=169248697, size=321, diff=4181, index=1 dts_time=1880.54
demuxer -> stream audio packet pts=169252876, dts=169252876, size=301, diff=4179, index=1 dts_time=1880.59
demuxer -> stream audio packet pts=169257055, dts=169257055, size=277, diff=4179, index=1 dts_time=1880.63
demuxer -> stream audio packet pts=169261234, dts=169261234, size=318, diff=4179, index=1 dts_time=1880.68
demuxer -> stream audio packet pts=169265413, dts=169265413, size=261, diff=4179, index=1 dts_time=1880.73
demuxer -> stream video packet pts=169263000, dts=169263000, size=499, diff=3780, index=0 dts_time=1880.7
demuxer -> stream video packet pts=169281720, dts=169266780, size=1760, diff=3780, index=0 dts_time=1880.74
demuxer -> stream video packet pts=169270470, dts=169270470, size=499, diff=3690, index=0 dts_time=1880.78
demuxer -> stream video packet pts=169274250, dts=169274250, size=510, diff=3780, index=0 dts_time=1880.83
demuxer -> stream video packet pts=169278030, dts=169278030, size=425, diff=3780, index=0 dts_time=1880.87
demuxer -> stream video packet pts=169285500, dts=169281720, size=2071, diff=3690, index=0 dts_time=1880.91
demuxer -> stream audio packet pts=169269595, dts=169269595, size=268, diff=4182, index=1 dts_time=1880.77
demuxer -> stream audio packet pts=169273774, dts=169273774, size=289, diff=4179, index=1 dts_time=1880.82
demuxer -> stream audio packet pts=169277953, dts=169277953, size=267, diff=4179, index=1 dts_time=1880.87
demuxer -> stream audio packet pts=169282132, dts=169282132, size=269, diff=4179, index=1 dts_time=1880.91
demuxer -> stream audio packet pts=169286311, dts=169286311, size=280, diff=4179, index=1 dts_time=1880.96
demuxer -> stream video packet pts=169292970, dts=169285500, size=4220, diff=3780, index=0 dts_time=1880.95
demuxer -> stream video packet pts=169289280, dts=169289280, size=2596, diff=3780, index=0 dts_time=1880.99
demuxer -> stream video packet pts=169296750, dts=169292970, size=13800, diff=3690, index=0 dts_time=1881.03
demuxer -> stream video packet pts=169300530, dts=169296750, size=8452, diff=3780, index=0 dts_time=1881.08
demuxer -> stream video packet pts=169308000, dts=169300530, size=11802, diff=3780, index=0 dts_time=1881.12
demuxer -> stream audio packet pts=169290493, dts=169290493, size=263, diff=4182, index=1 dts_time=1881.01
demuxer -> stream audio packet pts=169294672, dts=169294672, size=310, diff=4179, index=1 dts_time=1881.05
demuxer -> stream audio packet pts=169298851, dts=169298851, size=313, diff=4179, index=1 dts_time=1881.1
demuxer -> stream audio packet pts=169303030, dts=169303030, size=331, diff=4179, index=1 dts_time=1881.14
demuxer -> stream audio packet pts=169307209, dts=169307209, size=280, diff=4179, index=1 dts_time=1881.19
demuxer -> stream video packet pts=169304220, dts=169304220, size=3014, diff=3690, index=0 dts_time=1881.16
demuxer -> stream video packet pts=169311780, dts=169308000, size=10497, diff=3780, index=0 dts_time=1881.2
demuxer -> stream video packet pts=169323030, dts=169311780, size=10094, diff=3780, index=0 dts_time=1881.24
demuxer -> stream video packet pts=169315470, dts=169315470, size=1955, diff=3690, index=0 dts_time=1881.28
demuxer -> stream video packet pts=169319250, dts=169319250, size=931, diff=3780, index=0 dts_time=1881.33
demuxer -> stream video packet pts=169337970, dts=169323030, size=2733, diff=3780, index=0 dts_time=1881.37
demuxer -> stream audio packet pts=169311391, dts=169311391, size=330, diff=4182, index=1 dts_time=1881.24
demuxer -> stream audio packet pts=169315570, dts=169315570, size=299, diff=4179, index=1 dts_time=1881.28
demuxer -> stream audio packet pts=169319749, dts=169319749, size=289, diff=4179, index=1 dts_time=1881.33
demuxer -> stream audio packet pts=169323928, dts=169323928, size=296, diff=4179, index=1 dts_time=1881.38
demuxer -> stream audio packet pts=169328107, dts=169328107, size=287, diff=4179, index=1 dts_time=1881.42
demuxer -> stream video packet pts=169326720, dts=169326720, size=570, diff=3690, index=0 dts_time=1881.41
demuxer -> stream video packet pts=169330500, dts=169330500, size=590, diff=3780, index=0 dts_time=1881.45
demuxer -> stream video packet pts=169334280, dts=169334280, size=418, diff=3780, index=0 dts_time=1881.49
demuxer -> stream video packet pts=169349220, dts=169337970, size=838, diff=3690, index=0 dts_time=1881.53
demuxer -> stream video packet pts=169341750, dts=169341750, size=341, diff=3780, index=0 dts_time=1881.58
demuxer -> stream audio packet pts=169332289, dts=169332289, size=286, diff=4182, index=1 dts_time=1881.47
demuxer -> stream audio packet pts=169336468, dts=169336468, size=278, diff=4179, index=1 dts_time=1881.52
demuxer -> stream audio packet pts=169340647, dts=169340647, size=269, diff=4179, index=1 dts_time=1881.56
demuxer -> stream audio packet pts=169344826, dts=169344826, size=271, diff=4179, index=1 dts_time=1881.61
demuxer -> stream audio packet pts=169349005, dts=169349005, size=276, diff=4179, index=1 dts_time=1881.66
demuxer -> stream video packet pts=169345530, dts=169345530, size=402, diff=3780, index=0 dts_time=1881.62
... ... @@ -30,6 +30,39 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_log.hpp>
#include <srs_core_autofree.hpp>
SrsCodecSample::SrsCodecSample()
{
clear();
}
SrsCodecSample::~SrsCodecSample()
{
}
void SrsCodecSample::clear()
{
cts = 0;
nb_buffers = 0;
}
int SrsCodecSample::add_sample(char* bytes, int size)
{
int ret = ERROR_SUCCESS;
if (nb_buffers >= SRS_MAX_CODEC_SAMPLE) {
ret = ERROR_HLS_DECODE_ERROR;
srs_error("hls decode samples error, "
"exceed the max count: %d, ret=%d", SRS_MAX_CODEC_SAMPLE, ret);
return ret;
}
SrsCodecBuffer* buf = &buffers[nb_buffers++];
buf->bytes = bytes;
buf->size = size;
return ret;
}
SrsCodec::SrsCodec()
{
width = 0;
... ... @@ -62,7 +95,7 @@ SrsCodec::~SrsCodec()
srs_freep(stream);
}
int SrsCodec::audio_aac_demux(int8_t* data, int size)
int SrsCodec::audio_aac_demux(int8_t* data, int size, SrsCodecSample* sample)
{
int ret = ERROR_SUCCESS;
... ... @@ -109,11 +142,11 @@ int SrsCodec::audio_aac_demux(int8_t* data, int size)
if (aac_packet_type == SrsCodecAudioTypeSequenceHeader) {
// AudioSpecificConfig
// 1.6.2.1 AudioSpecificConfig, in aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 33.
aac_extra_size = size - stream->pos();
aac_extra_size = stream->left();
if (aac_extra_size > 0) {
srs_freepa(aac_extra_data);
aac_extra_data = new char[aac_extra_size];
memcpy(aac_extra_data, data + stream->pos(), aac_extra_size);
memcpy(aac_extra_data, stream->current(), aac_extra_size);
}
} else if (aac_packet_type == SrsCodecAudioTypeRawData) {
// ensure the sequence header demuxed
... ... @@ -125,6 +158,10 @@ int SrsCodec::audio_aac_demux(int8_t* data, int size)
// Raw AAC frame data in UI8 []
// 6.3 Raw Data, aac-iso-13818-7.pdf, page 28
if ((ret = sample->add_sample(stream->current(), stream->left())) != ERROR_SUCCESS) {
srs_error("hls add audio sample failed. ret=%d", ret);
return ret;
}
} else {
// ignored.
}
... ... @@ -135,7 +172,7 @@ int SrsCodec::audio_aac_demux(int8_t* data, int size)
return ret;
}
int SrsCodec::video_avc_demux(int8_t* data, int size)
int SrsCodec::video_avc_demux(int8_t* data, int size, SrsCodecSample* sample)
{
int ret = ERROR_SUCCESS;
... ... @@ -175,17 +212,17 @@ int SrsCodec::video_avc_demux(int8_t* data, int size)
int8_t avc_packet_type = stream->read_1bytes();
int32_t composition_time = stream->read_3bytes();
// avoid warning, used it future.
(void)composition_time;
// pts = dts + cts.
sample->cts = composition_time;
if (avc_packet_type == SrsCodecVideoAVCTypeSequenceHeader) {
// AVCDecoderConfigurationRecord
// 5.2.4.1.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 16
avc_extra_size = size - stream->pos();
avc_extra_size = stream->left();
if (avc_extra_size > 0) {
srs_freepa(avc_extra_data);
avc_extra_data = new char[avc_extra_size];
memcpy(avc_extra_data, data + stream->pos(), avc_extra_size);
memcpy(avc_extra_data, stream->current(), avc_extra_size);
}
if (!stream->require(6)) {
... ... @@ -222,7 +259,7 @@ int SrsCodec::video_avc_demux(int8_t* data, int size)
// One or more NALUs (Full frames are required)
// 5.3.4.2.1 Syntax, H.264-AVC-ISO_IEC_14496-15.pdf, page 20
int PictureLength = size - stream->pos();
int PictureLength = stream->left();
for (int i = 0; i < PictureLength;) {
if (!stream->require(NAL_unit_length + 1)) {
ret = ERROR_HLS_DECODE_ERROR;
... ... @@ -246,6 +283,10 @@ int SrsCodec::video_avc_demux(int8_t* data, int size)
return ret;
}
// 7.3.1 NAL unit syntax, H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
if ((ret = sample->add_sample(stream->current(), NALUnitLength)) != ERROR_SUCCESS) {
srs_error("hls add video sample failed. ret=%d", ret);
return ret;
}
stream->skip(NALUnitLength);
i += NAL_unit_length + 1 + NALUnitLength;
... ...
... ... @@ -30,6 +30,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
#define SRS_MAX_CODEC_SAMPLE 128
class SrsStream;
// E.4.3.1 VIDEODATA
... ... @@ -162,6 +164,33 @@ enum SrsCodecAudioSoundType
};
/**
* buffer indicates the position and size.
*/
struct SrsCodecBuffer
{
int size;
char* bytes;
};
/**
* the samples in the flv audio/video packet.
*/
class SrsCodecSample
{
public:
int nb_buffers;
SrsCodecBuffer buffers[SRS_MAX_CODEC_SAMPLE];
// CompositionTime, video_file_format_spec_v10_1.pdf, page 78.
// cts = pts - dts, where dts = flvheader->timestamp.
int32_t cts;
public:
SrsCodecSample();
virtual ~SrsCodecSample();
void clear();
int add_sample(char* bytes, int size);
};
/**
* Annex E. The FLV File Format
*/
class SrsCodec
... ... @@ -212,8 +241,8 @@ public:
virtual ~SrsCodec();
// the following function used for hls to build the codec info.
public:
virtual int audio_aac_demux(int8_t* data, int size);
virtual int video_avc_demux(int8_t* data, int size);
virtual int audio_aac_demux(int8_t* data, int size, SrsCodecSample* sample);
virtual int video_avc_demux(int8_t* data, int size, SrsCodecSample* sample);
// the following function used to finger out the flv/rtmp packet detail.
public:
/**
... ...
... ... @@ -31,11 +31,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SrsHLS::SrsHLS()
{
codec = new SrsCodec();
sample = new SrsCodecSample();
}
SrsHLS::~SrsHLS()
{
srs_freep(codec);
srs_freep(sample);
}
int SrsHLS::on_publish()
... ... @@ -134,7 +136,12 @@ int SrsHLS::on_audio(SrsCommonMessage* audio)
{
int ret = ERROR_SUCCESS;
if ((ret = codec->audio_aac_demux(audio->payload, audio->size)) != ERROR_SUCCESS) {
sample->clear();
if ((ret = codec->audio_aac_demux(audio->payload, audio->size, sample)) != ERROR_SUCCESS) {
return ret;
}
if (codec->audio_codec_id != SrsCodecAudioAAC) {
return ret;
}
... ... @@ -145,7 +152,8 @@ int SrsHLS::on_video(SrsCommonMessage* video)
{
int ret = ERROR_SUCCESS;
if ((ret = codec->video_avc_demux(video->payload, video->size)) != ERROR_SUCCESS) {
sample->clear();
if ((ret = codec->video_avc_demux(video->payload, video->size, sample)) != ERROR_SUCCESS) {
return ret;
}
... ...
... ... @@ -31,12 +31,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
class SrsOnMetaDataPacket;
class SrsCommonMessage;
class SrsCodecSample;
class SrsCodec;
class SrsHLS
{
private:
SrsCodec* codec;
SrsCodecSample* sample;
public:
SrsHLS();
virtual ~SrsHLS();
... ...
... ... @@ -87,6 +87,16 @@ int SrsStream::pos()
return p - bytes;
}
int SrsStream::left()
{
return size - pos();
}
char* SrsStream::current()
{
return p;
}
int8_t SrsStream::read_1bytes()
{
srs_assert(require(1));
... ...
... ... @@ -74,6 +74,11 @@ public:
* tell the current pos.
*/
virtual int pos();
/**
* left size of bytes.
*/
virtual int left();
virtual char* current();
public:
/**
* get 1bytes char from stream.
... ...