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.

Problem about the DM365 YUV420SP video format

I'm desiging a video recording system on DM365 with DVSDK 4.0 . The input source is composite D1 video. The captured video is sent to H.264 Video Encoder and display device.

 I use DMAI for video capture/encode/display.   The displayed video is NOT the same size as captured video, so Resizer is required. Since H.264 video encoder for DM365 accepts only YUV420SP input, I have two choice:

A). configure DMAI Capture to output YUV420SP video to make H.264 encoder happy. But the problems is:

   1.DMAI Resizer doesn't work for YUV420SP.

   2.If capture in 420SP mode, the resizer driver in linux kernel doesn't allow to be opened again.

B). configure DMAI Capture to output UYVY video to make Resizer happy. But the problem is: I have to convert UYVY to YUV420SP. I'm not sure if DMAI Resizer can do this. Even if the Resizer do, it will consume additional DDR bandwidth.

Can anyone give me some advice? thanks

  • Hi,

    Why dont you use the capture to give you two different resolutions (one for your H.264 encoder and other for display) simultaneously in YUV420SP format. The resizer module supports that.

    In this case you will save DDR bandwidth as well as another iteration of resize operation.

    Basically look for enabling the RSZB in the resizer driver. This is named as "output2" in the rsz_continuous_config structure.

    Regards,

    Anshuman

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

  • Thanks.

    I think I should describe my requirement in more detail. In our system, we have 2 h.264 encoders. On encoder works in D1 for storage, another works in CIF for transmission. The live video display device is an SVGA monitor. So at least 3 different resolutions is needed. The capture driver could give only 2 resolutions, right?

  • Ok,

    Now i understand better. Actually, resizer driver in DM36x supports YUV420SP to YUV420SP conversion but not sure about DMAI layer though. I will have to check with some other people about this. Meanwhile, you can try to modify the DMAI code to see if you can get the resizer driver to configure in YUV420SP input mode.

    BTW, to make things simpler, anyways, you have to do another resize operation, then why not get SVGA resolution for your monitor in first pass in YUV422 mode and then again run resizer to get two outputs in YUV420SP mode for D1 and CIF resolution of H.264 encoding.

    Regards,

    Anshuman

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

  • Thank you,

    That is a good idea. If I don't misunderstand you, do you mean V4L2 works in OnTheFly mode to output SVGA UYVY to DDR, then resize SVGA UYVY to D1/CIF YUV420SP?

    If so, the DMAI Resizer has to be used. In my test, the resizer driver can't be opened if V4L2 works in OnTheFly mode.

    Regards

    lcj

  • Hi,

    If you have configured resizer in OnTheFly Mode using V4L2 driver, then you cannot run resizer again in single shot mode. So to implement the suggestion that i had, you should configure the resizer in single shot mode and then run resizer twice, once for SVGA UYVY and then again to get D1/CIF YUV420SP.

    BTW, please help me remember if you had input in bayer format or YUV format. If you have YUV format SVGA input coming from the sensor interface, then you might not need the first resize operation i mentioned in the email above.

    I hope you are clear on this.

    Regards,

    Anshuman

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

  • Hi,

     The input is D1 in UYVY format from CCD camera.

    So I have to configure resizer in single-shot mode.

    In this case, the V4L2 driver output must be UYVY interlaced video, so

    A.  for CIF h.264 encoding: the resizer should convert D1 UYVY to CIF YUV420SP

    B. for D1 h.264 encoding: Since V4L2 output is interlaced,  the resizer should convert interlaced D1 UYVY to progressive D1 YUV420SP

    C.for SVGA display: the resizer should convert D1 UYVY to SVGA YUV420SP

    So the resizer have to run three times.

    Am I right?

    Regards,

    lcj

  • Ok,

    So the data flow i can think of is as follows:

    1. Open resizer in "single shot" mode. This means do not connect resizer driver in capture

    2. Run resizer once to do D1 UYVY --> SVGA YUV420SP for display and D1 YUV420SP for encode. Please note that you can get two outputs of different resolution in single run of RESIZE ioctl.

    3. In next run of resizer take D1 YUV420SP to get CIF YUV420SP.

    Regards,

    Anshuman

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

     

  • I'm clear about that now. Thank you, Anshuman.

    Regards

    lcj

  • Hi ,Anshuman

    I use dvsdk4.0 and dm368-evm board,now I want to decode a video streaming,and then resize it to  640*480 to display on the LCD ,the input video colorspace is YUV420SP.my trouble is :when I set the resize_config inbuf is YUV420SP ,it always point out resieze_config failed! when I changed the resize_config inbuf is UYVY ,it's ok, but,when I run the demo do_resize_420_420 which in the dvsdk psp , it could run successfully, so why? I think the driver have support the resize_config inbuf is YUV420,maybe the dmai layer don't support ,if it is like this ,where should I to modify  the dmai? thanks very much!