RTP h264 notes (FU-A subcontracting instructions)

Source: Internet
Author: User

I wrote an article earlierArticleAnalysis of the format of using RTP for h264 packets: RTP encapsulation of h264. However, it seems that the split and some situations that need attention are not clearly stated, so here we will make a supplement and also serve as our own memo (I don't seem to have a good memory ).

    1. note that the sampling rate of h264 is 90000Hz, so the unit of the timestamp is 1 (second)/90000. Therefore, if the current video frame rate is 25 FPS, the timestamp interval or increment should be 3600. If the frame rate is 30fps, the increment is 3000, and so on.
    2. about h264 unpacking, according to FU-A instructions:
      1) Fu indicator: F of the first FU-A package should be f of the current NALU header, while NRI should be the nri of the current NALU header, type is equal to 28, indicating it is a FU-A package. Fu header generation method: S = 1, E = 0, r = 0, type is equal to the type in the NALU header.
      2) The fu indicator of n subsequent FU-A packages is exactly the same as that of the first one. If not, the Fu header should be: S = 0, E = 0, r = 0, and type is equal to the type in the NALU header.
      3) The last FU-A package Fu header should be: S = 0, E = 1, r = 0, type is equal to the type in the NALU header.

      therefore, it is concluded that the thick Fu indicator headers of the same NALU package are completely consistent, and the Fu header only has the difference between S and E bits, mark start and end, respectively. The serial numbers of their RTP packets should increase sequentially, and their timestamps must be consistent, when the load data is the NALU packet, it is critical to split the remaining data after removing the One-byte NALU header. You can think that the NALU header is split into Fu indicator and Fu header, therefore, the 1-byte NALU header is no longer required.

    3. for the SPS and PPS, I used the first-mover SPS for frame transmission, and then sent the PPS with the same timestamp, you can also follow the normal timestamp increment or the group package sending format to see how the player is decoded. Also, if we use VLC for playback, you can set SPS and PPs in the SDP file so that you do not need to send them.
    4. when VLC is used for playback, the packet mode option in the SDP file is packetization-mode = 1. Otherwise, the problem may occur. In addition, the encoding type set in the SDP must be consistent with that in the RTP package.

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.