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.

Compiler: How to encode YUV422 to h.264 format video file

Tool/software: TI C/C++ Compiler

Hi TI

  I have 4 camera, camera output YUV422 format data, I want encode YUV422 format data save as h.264 video file

  How can i do it?

The current plan I'm working on, 4 camera(YUV422) --> capture(UYVY) --> LDC(NV12) --> Mosaic(NV12) --> Encode(h.264)。

it works occured error, the error is :

[MCU2_0] 47.909020 s: data will not fit into plane (1442880 < 3220288)
[MCU2_0] 47.909080 s: VX_ZONE_ERROR:[tivxVideoEncoderProcess:303] MM_ENC Buf Prepare failed
[MCU2_0] 47.909127 s: VX_ZONE_ERROR:[tivxTargetKernelExecute:370] Kernel process function for [com.ti.hwa.video_encoder] returned error code: -1

  • Has anyone replay?

  • Hi Hongji li,

    From the error log I assume you are using TDA4 RTOS SDK.

    The error points to the scenario where you are providing different Image resolutions for graph create and process.

    So, please share you application code for creating and processing the graph along with the resolution

    Also please share the SDK version you are using.

    Thanks & Regards,

    Sunita.

  • Hi Sunita,
        I use TDA4 RTOS SDK, the version is 7.0

        The attachment is my source code

    thank you!app_video.rar

  • Hi Hongji li,

    Thanks sharing more details. Looks like you have created the graph with 1280x720 resolution, however not clear on which images are being used for processing the encode graph.

    Please print the below highlighted parameters and check what buffer resolutions are being sent to graph process.

    File: tiovx/tiovx_dev/kernels_j7/hwa/venc/vx_video_encoder_target.c

    Function: tivxVideoEncoderProcess {

    ..................

    ..................


    encoder_obj->in_buff.chId = encoder_obj->channel_id;
    encoder_obj->in_buff.type = MM_BUF_TYPE_VIDEO_INPUT;
    encoder_obj->in_buff.num_planes = input_image_desc->planes;
    encoder_obj->in_buff.size[0] = input_image_desc->mem_size[0];
    encoder_obj->in_buff.size[1] = input_image_desc->mem_size[1];
    encoder_obj->in_buff.buf_addr[0] = input_image_target_ptr_y;
    encoder_obj->in_buff.buf_addr[1] = input_image_target_ptr_uv;

    encoder_obj->out_buff.chId = encoder_obj->channel_id;
    encoder_obj->out_buff.type = MM_BUF_TYPE_VIDEO_OUTPUT;
    encoder_obj->out_buff.num_planes = 1;
    encoder_obj->out_buff.size[0] = output_bitstream_desc->mem_size;
    encoder_obj->out_buff.buf_addr[0] = bitstream;

    mm_status = MM_ENC_BufPrepare(&encoder_obj->in_buff, encoder_obj->channel_id);
    mm_status |= MM_ENC_BufPrepare(&encoder_obj->out_buff, encoder_obj->channel_id);

    .............

    ...................

    }

    Thanks & Regards,

    Sunita.