SPS & PPS & SEI

转载自https://www.jianshu.com/p/6c532568be1c

海思不是有demo,存h264文件吗?你可以把数据导出来看看啊,只需要做个地址偏移就可以得到sps、pps了

nal_unit_type

NAL : Network Abstraction Layer

SPS & PPS & SEI_第1张图片

Table 7-1 – NAL unit type codes Part1

 

SPS & PPS & SEI_第2张图片

Table 7-1 – NAL unit type codes Part2

 

NALU Frequently Used

  • IDR
    Instantaneous Decoding Refresh
    nal_unit_type = 5

  • SPS
    Sequence Parameter Set(序列参数集)
    nal_unit_type = 7
    包含H.264的profile_idclevel_idc等信息.
    还有图像的宽高:
    pic_width_in_mbs_minus1
    pic_height_in_map_units_minus1

Note: 以下为简易公式,仅供示意用:
// pic_width_in_mbs_minus1 本句法元素加 1 后指明图像宽度,以宏块为单位: PicWidthInMbs = pic_width_in_mbs_minus1 + 1 通过这个句法元素解码器可以计算得到亮度分量以像素为单位的图像宽度: PicWidthInSamplesL = PicWidthInMbs * 16
pic_width_in_mbs_minus1 = 21
// pic_height_in_map_units_minus1 本句法元素加 1 后指明图像高度: PicHeightInMapUnits = pic_height_in_map_units_minus1 + 1
pic_height_in_map_units_minus1= 17
分别表示图像的宽和高,
以宏块(16x16)为单位的值减1
因此,实际的宽为 (21 + 1) * 16 = 352

  • PPS
    Picture Parameter Set(图像参数集)
    nal_unit_type = 8

  • SEI
    Supplementary Enhancement Information
    nal_unit_type = 6
    SEI是H264标准中一个重要的技术,主要起补充和增强的作用。
    SEI没有图像数据信息,只是对图像数据信息或者视频流的补充,
    有些内容可能对解码有帮助.

Supplemental Enhancement Information (SEI) contains information that is not necessary to decode VCL NAL units.

SPS & PPS & SEI_第3张图片

SEI

海康摄像头的RTSP流分析

!!!!!Video nTimeStamp = 1468902463581, Video nFrameType = 7
[Date: 2016.7.19, Time: 12:27:43:576]

!!!!!Video nTimeStamp =1468902463581, Video nFrameType = 8
[Date: 2016.7.19, Time: 12:27:43:576]

!!!!!Video nTimeStamp = 1468902463581, Video nFrameType = 6
[Date: 2016.7.19, Time: 12:27:43:877]

!!!!!Video nTimeStamp = 1468902463581, Video nFrameType = 5

[Date: 2016.7.19, Time: 12:27:43:878]
!!!!!Video nTimeStamp = 1468902463621, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:152]
!!!!!Video nTimeStamp = 1468902463661, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:210]
!!!!!Video nTimeStamp = 1468902463701, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:220]
!!!!!Video nTimeStamp = 1468902463741, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:253]
!!!!!Video nTimeStamp = 1468902463781, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:258]
!!!!!Video nTimeStamp = 1468902463821, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:268]
!!!!!Video nTimeStamp = 1468902463861, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:273]
!!!!!Video nTimeStamp = 1468902463901, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:279]
!!!!!Video nTimeStamp = 1468902463941, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:287]
!!!!!Video nTimeStamp = 1468902463981, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:293]
!!!!!Video nTimeStamp = 1468902464021, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:310]
!!!!!Video nTimeStamp = 1468902464061, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:317]
!!!!!Video nTimeStamp = 1468902464101, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:327]
!!!!!Video nTimeStamp = 1468902464141, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:333]
!!!!!Video nTimeStamp = 1468902464181, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:340]
!!!!!Video nTimeStamp = 1468902464221, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:351]
!!!!!Video nTimeStamp = 1468902464261, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:357]
!!!!!Video nTimeStamp = 1468902464301, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:381]
!!!!!Video nTimeStamp = 1468902464341, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:429]
!!!!!Video nTimeStamp = 1468902464381, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:449]
!!!!!Video nTimeStamp = 1468902464421, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:479]
!!!!!Video nTimeStamp = 1468902464461, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:537]
!!!!!Video nTimeStamp = 1468902464501, ideo nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:549]
!!!!!Video nTimeStamp = 1468902464541, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:582]
!!!!!Video nTimeStamp = 1468902464581, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:632]
!!!!!Video nTimeStamp = 1468902464621, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:44:747]
!!!!!Video nTimeStamp = 1468902464661, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:843]

!!!!!Video nTimeStamp = 1468902464701, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:849]

!!!!!Video nTimeStamp = 1468902464741, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:898]

!!!!!Video nTimeStamp = 1468902464781, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:905]

!!!!!Video nTimeStamp = 1468902464821, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:945]

!!!!!Video nTimeStamp = 1468902464861, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:973]

!!!!!Video nTimeStamp = 1468902464901, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:44:983]

!!!!!Video nTimeStamp = 1468902464941, sec = 1468902464, usec=941077, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:45]

!!!!!Video nTimeStamp = 1468902464981, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:146]

!!!!!Video nTimeStamp = 1468902465021, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:199]

!!!!!Video nTimeStamp = 1468902465061, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:205]

!!!!!Video nTimeStamp = 1468902465101, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:258]

!!!!!Video nTimeStamp = 1468902465141, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:45:307]

!!!!!Video nTimeStamp = 1468902465181, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:188]

!!!!!Video nTimeStamp = 1468902465221, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:233]

!!!!!Video nTimeStamp = 1468902465261, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:235]

!!!!!Video nTimeStamp = 1468902465301, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:272]

!!!!!Video nTimeStamp = 1468902465341, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:279]

!!!!!Video nTimeStamp = 1468902465381, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:284]

!!!!!Video nTimeStamp = 1468902465421, Video nFrameType = 1
[Date: 2016.7.19, Time: 12:27:46:302]
!!!!!Video nTimeStamp = 1468902465461, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:46:313]
!!!!!Video nTimeStamp = 1468902465501, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:46:336]
!!!!!Video nTimeStamp = 1468902465541, Video nFrameType = 1

[Date: 2016.7.19, Time: 12:27:46:340]
!!!!!Video nTimeStamp = 1468902465581, Video nFrameType =7

[Date: 2016.7.19, Time: 12:27:46:341]
!!!!!Video nTimeStamp = 1468902465581, Video nFrameType = 8

[Date: 2016.7.19, Time: 12:27:46:341]
!!!!!Video nTimeStamp = 1468902465581, Video nFrameType = 6

[Date: 2016.7.19, Time: 12:27:46:697]
!!!!!Video nTimeStamp = 1468902465581, Video nFrameType = 5

[Date: 2016.7.19, Time: 12:27:46:747]
!!!!!Video nTimeStamp = 1468902465621, Video nFrameType = 1

可看出发送流的次序为7->8->6->5->1...1->7->8->6->5->1...1->7
并且SPS & PPS & SEI & IDR 的时间戳相同.


 

你可能感兴趣的:(H264)