H264 data after encoding with X264

Source: Internet
Author: User

The input data is ready, and the encoded data is in an array of x264_nal_t. The parameter I set here is baseline profile, so there is no B-frame after encoding, after the encoding of the data after the analysis found that the first time there will be 4 nal, SPS, PPS, SEI, I-frame, respectively, is 00 00 00 01 67, 00 00 00 01 68 , 00 00 01 06, 00 00 01 The beginning of 65 data segments, it is noted that the SEI and I frame at the beginning of the X264 is four 00 00 of the starting head, should be and the source of such a relationship, but there is no big deal, is the back in the beginning of the deletion of these starting head will have two kinds of judgement. Then encode the second frame image, get a nal, is P-frame 00 00 01 41.

Here are some of the parameters I encountered and confusion, at first I found in the analysis of the data, the first time is 5 nal, that is, SPS, PPS, SEI, I-frame, I-frame, the second time the encoding is 2 nal, that is, p-frame, p-frame, this is how it happened, the original is a number of threads running param.b_sliced_threads= false; you will find it normal.

And I have to control a few p, that is, the number of a GOP, then you need to set the value of M_param.i_keyint_max.  The other is in m_param.b_repeat_headers = 1; Repeating the Sps/pps is placed in front of the keyframe, so that the setting facilitates decoding of the SPS and PPS in each I-frame.

H264 data after encoding with X264

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.