How to package h264 data with RTP

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.