H.264 over RTP - Identify SPS and PPS Frames

后端 未结 2 534
自闭症患者
自闭症患者 2021-01-30 15:05

I have a raw H.264 Stream from an IP Camera packed in RTP frames. I want to get raw H.264 data into a file so I can convert it with ffmpeg.

So when I want t

2条回答
  •  情深已故
    2021-01-30 15:34

    1. If the SPS and PPS do not change, you could omit them except the 1st ones.
    2. You need to parse the nal_unit_type field of each NAL, for SPS, nal_unit_type==7; for PPS, nal_unit_type==8.

    As I remember, nal_unit_type is the lower 5 bits of the 1st byte of a frame.

    nal_unit_type = frame[0] & 0x1f;
    

提交回复
热议问题