X264 Decoder complete frame not come in one NAL Unit

大城市里の小女人 提交于 2019-12-02 09:33:08

Can you send your encoder code? Normally you should have the following code:

naluSize=x264_encoder_encode(h, &nal, &i_nal, pic, &pic_out);
if(naluSize_size>0)
{
    memcpy(Framebuffer, nal[0].p_payload, frame_naluSize);
    FrameBufferSize= frame_naluSize;
}

So you will have your encoded frame in Framebuffer and its size is in FrameBufferSize. This works like a charm in my application.

Another advice is not to touch any parameters (at least till you solve your problems) that you don't have any idea about. Just use

x264_param_default_preset(&param, "ultrafast", "zerolatency");

This will set many parameters for you. Of course, don't forget to set the resolution :)

Need WAY more information for a complete answer, but just a guess. If the first NALU is an AUD (type 9), You can ignore it. Or do not generate them in the first place by setting b_aud = 0.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!