-
Refer to RTMP protocol encapsulation of H264 and H265 protocols for detailed analysis by experts
-
Receive the 264 code stream returned by flv demux or decoder or camera, usually from annexb
-
rtmp needs to be converted to avcc for push.
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
first 5 bytes
-
The first byte is 0x17, 1 represents the avc header. 7 is codecid h264
-
1 character after