This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can dm365's h264 encoder encode data in YUV422 format, instead of YUV420 SP?

Hi,

I  want to encode video buffers into h264 format. The following code works fine.

    VIDENC1_Params  encParams;

    memset(&encParams, 0, sizeof(VIDENC1_Params));

    encParams.size                  = sizeof(VIDENC1_Params);
        encParams.encodingPreset        = XDM_HIGH_SPEED;
        encParams.rateControlPreset     = IVIDEO_NONE;
        encParams.maxFrameRate          = 30000;
        encParams.maxBitRate            = 0;
        encParams.maxWidth              = width;
        encParams.maxHeight             = height;
        encParams.inputContentType      = IVIDEO_PROGRESSIVE;
        encParams.inputChromaFormat     = XDM_YUV_420SP;
        encParams.reconChromaFormat     = XDM_YUV_420SP;
        encParams.dataEndianness        = XDM_BYTE;
        encParams.maxInterFrameInterval = 0;


    enc = VIDENC1_create(ce, (char*)ENCODER_NAME, &encParams);

 

 

But the buffer I get from video_in is YUV422. So I changed the red line to

     encParams.inputChromaFormat     = XDM_YUV_422P;
     encParams.reconChromaFormat     = XDM_YUV_422P;

 

Now, VIDENC1_create returns NULL.

 

So, doesn't h264 encoder support YUV422 format?

Thanks a lot.

Kevin

 

  • Hi,

    I assume you are talking about DM36x platform.

    The input buffer for H.264 encoder has to be YUV420SP format data as described in the data sheet of the encoder. We do not have support for YUV422 format.

    BTW, what do you mean by the statement that you get video in YUV422? We have resizers in DM36x which can directly give the output as YUV420SP needed by H.264 encoder. If you could explain little more details about your usage scenario, we can help with the best possible configuration.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • hi, Anshuman 

    how can we resize yuv422ile to yuv420sp?