The raw stream data obtained from h264 is. Generally, the bitstream structure is SPS, PPS, I frame, P frame ...... SPS, PPS, I frame, P frame ............ When we use RTP to package h264 data, SPS and PPS can directly send I and P frames without sending them. It also depends on the size of I frame and P frame. If it is smaller than MTU, it can be sent directly with the RTP package. If it is larger than MTU, it will be scored. For more information about the sharding method, see rfc3984.
I'm using a FU-A, sharding method.
Fu indicator of the first FU-A package should be: F = f; NRI = NRI; type = 28 in the NALU header. Fu header should be: S = 1; E = 0; r = 0; type = type in the NALU header.
The fu indicator of the second FU-A package should be: F = f; NRI = NRI; type = 28 in the NALU header. Fu header should be: S = 0; E = 0; r = 0; type = type in the NALU header.
The fu indicator of the third FU-A package should be: F = f; NRI = NRI; type = 28 in the NALU header. Fu header should be: S = 0; E = 1; r = 0; type = type in the NALU header.
The data format of frame I is usually 00 00 00 01 65 ×××× ..................... ......... Among them, 00 00 01 is used to identify a frame, 65 is the nal unit header, and the following data is nal unit data. The data sent by RTP is after 00 00 01. note that the data in the partition unit starts after 65, and 65 is the nal unit header, which has a relationship with the partition unit header. The specific relationship has been clearly written above.