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.

RGB video capture and YUV encoding of DM814x?

Greetings,

In this thread, there is a discussion regarding video capture and encoding capability of Davinci.

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/156922.aspx#571293

So, basically DM814x is able to capture RGB888 and only able to encode under YUV420, right?

Now, I am able to capture RGB888 discrete sync, how can I down_sampling the data to be encoded by Soc?

My capture is based on v4l2 API instead of v4l2src from gstreamer and from here I want to use omx_h264enc and other gstreamer elements to do video processing.

Could anyone point out me a direction to go?

Regards,

Jun

  • What I want is capturing RGB video data, convert it into yuv420, load it on the omx_h264enc.

    Ok, after going through my problem again, I guess I figure out it. Please correct me if I am wrong.

    Although the HDMI decoder output is RGB , in the  ti81xx_fb, I need set the video format as yuv instead of RGB?

    Regards,

    Jun

  • Hi.

    HDVPSS can convert incoming RGB data to YUV data. You need to set RGB only in ti81xx_fb. But while doing set_format you need to select the dataformat as NV_12. So internally driver will convert from RGB-->YUV444-->YUV422-->YUV420. Out in memory will be YUV420.

    Regards,

    Hardik Shah

  • Hi Hardik,

    Thansk for your reply very much.

    I assume that "set_format" you mentioned should be inside SaLoopBackFbdev.c

    So, I have changedcapt.fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_NV12, and I am going to run some test.

    Although, I tried V4L2_PIX_FMT_YUV422P and when I replayed the captured data it is still RGB.

    static int setupCapture(void)
    {

    //...

      capt.fmt.fmt.pix.bytesperline = capt.fmt.fmt.pix.width ;
     capt.fmt.fmt.pix.sizeimage = capt.fmt.fmt.pix.bytesperline *
      capt.fmt.fmt.pix.height*3/2;
     capt.fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_NV12;//V4L2_PIX_FMT_YUV422P;//V4L2_PIX_FMT_RGB24;//
     ret = ioctl(capt.fd, VIDIOC_S_FMT, &capt.fmt);

    //...
     }

     

    Regards.

     

    Jun

  • Hi Hardik,

    Now I can capture and converted into yuv422p and I am using a software to replay, which shows the captured data is fine.

    However, when trying to convert the video data into yuv420 using above settings, and I cannot replay it properly.

    Do you know why is that?

    Regards,

    Jun

  • Hi,

    This may be because most of the player works with YUV420 planar format i.e. y, u and v all three components are in different planes. But output of capture is YUV420 semi planar where y is in one plane and u and v interleaved in one plane. So there are total 2 planes. Codecs also works with same format so you will be able to encode.

    Regards,

    Hardik Shah