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.

How to combine 2 D1 video into HD dispaly(1920x1080) ?

Hi everyone,

I am working on NVR product and was assiged to implement multi video stream input (or multi media file playback) to show at least 4 video images on FULL HD LCD screen simultaneously. 

I am using DaVinci DMAI module to implement it, but I do not know how to combine 2 video into framebuffer !!!

I got display buffer handle "hDstBuf" from:

Display_get(hDisplay, &hDstBuf);

and got video source from FiFo:

Fifo_get(envp->hInFifo, &hSrcBuf1);

Fifo_get(envp->hInFifo, &hSrcBuf2);

Now how can I combine hSrcBuf1 and hSrcBuf2 and then copy to Display buffer "hDstBuf" ??

Thanks if any suggestion !!!

Tai Chang.

  • I am not all that familiar with DMAI interface yet, but I would imagine you may have to do some manipulation of the video data outside of DMAI to get this working.   Your title suggests two D1 video inputs, but your message suggests you want four inputs (assume D1) being merged and displayed in a single HD output (no HD resolution specified).  As you know, D1 signals are normally 720x480 (for NTSC) so two or four may not necessarily fit evenly into a single HD output (say 1920x1080 assuming 1080i); for example 4 video inputs at D1 = 1440 x 960 pixels.  This means you would either have to resize or fill the rest of the buffer with a background color (e.g. black).    Do you know what you desired HD output reolution should be?

  • To do compositing of multiple video sources within a bigger video window, you'll need to use a 2-D DMA transfer - this will allow you to DMA the 2 D1 streams into the larger framebuffer for the 1080I stream while ensuring the video is spatially correct. This will require you write a DMA wrapper driver for the existing Davinci EDMA driver to allow you to do this from user-space.

  • Dear Juan,

    The target output resolution is 1920x1080 via HDMI or Component to LCD TV.

    1. About 2 D1 video (1440x480 place in left & right) can be merged into HD frame and let the rest part in black. Like PIP mode on TV Set.
    2. About 4 D1 video that inside HD frame is also ok, no need to resize. like below.(still have black bars on both up and down side)

     

     

      

    thanks for reply,

    Tai Chang.

  • If we refer to the video source buffers as A, B, C, D, what we want in the destination buffer is

    line 1 of buffer A, followed by line 1 of buffer B

    line 2 of buffer A, followed by line 2 of buffer B

    line 3 of buffer A, followed by line 3 of buffer B

    .....

    line 480 of buffer A, followed by line 480 of buffer B

    line 1 of buffer C, followed by line 1 of buffer D

    line 2 of buffer C, followed by line 2 of buffer D

    line 3 of buffer C, followed by line 3 of buffer D

    .....

    line 480 of buffer C, followed by line 480 of buffer D

    line 1 of buffer C, followed by line 1 of buffer D

    This means you will need to move one line at a time from your source buffers into the corresponding location (outlined above) in your destination buffer.  You can do this in a variety of ways, but as Jerry pointed out, this is best done using DMA transactions.  We do provide a DMA linux driver, but it is only accessible by other kernel modules, hence as Jerry pointed out you will need to write a wrapper if you want to initiate the DMA transfers from user space.  Alternatively, you can write a driver to do all this work in kernel space.

  • Dear Juan,

    The concept is really helpful to me.

    The last line " line 1 of buffer C, followed by line 1 of buffer D",

    I think it should be "line 1 of buffer A, followed by line 1 of buffer B" ... correct me if I am wrong.

     

    I think I will write a wrapper function in user space.

     Thanks a lot ! [;)]

     

     

    Tai Chang,  Taiwan

     

  • The last line should not have been there (copy and paste mistake), the end of your HD frame should be line 480 of your C and D images.

  • Oh..

    Yes, you are right, the line is for next frame...can not be wrapped.

    3Q,

     

    Tai Chang