【rtmp】2: rtmp push annexb

Push the AVCSequenceHeader first, then push the AVC NALU

  • AVCDecoderConfigurationRecord inside AVCSequenceHeader

  • AVC NALU

  • Both AVCSequenceHeader and AVC NALU have similar first five bytes.

Most of what rtmp pushes is h264 of annexb

  • Therefore, we use this format to convert it to rtmp avcc and push it to the server.

  • Generally, there is a 4-byte start code in front of sps and pps, so it should be skipped and not included in the length of sps and pps.

For video, send the avc header first

Insert image description here

first 5 bytes

  • The first byte is 0x17, 1 represents the avc header. 7 is codecid h264

  • 1 character after

Guess you like

Origin blog.csdn.net/commshare/article/details/132027925