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.

Picture-in-Picture implementation in dm368

Hi ,

I am using DM368 evm with dvsdk-4 for dm368. Can any one help to implement Picture-In-Picture (PIP) video in dm368 such that i want to display the decoded frame on video2 and captured frame on top of that at one corner using video3.

 

I am trying to change the co-ordinates of video3 window by changing the values in the following registers at run time

OSD_VIDWIN1XP,OSD_VIDWIN1YP,OSD_VIDWIN1XL,OSD_VIDWIN1YL the values in the registers are changing, but the display is coming with 1280x720 starting from 0-0 cordinates. Can any body give me some suggestions to change the VID1 window co-ordinates.

 

  • Venu,

    VPBE user guide section 4.4 (4.4.2.3 to be precise) talks clearly about OSD windows positioning including what registers to change. You can refer the same in case you have not done that.

    And, please provide more details such as what values(format, size etc) you are setting, also provide us with a screenshot of whatever you are observing. It will be easier to decode the problem.

  • Hi Nagabhushana,


    Thanks for ur reply. I changed the settings as per mentioned in vpbe user guide under 4.4.23 section by hard coding in  davinci_osd.c , now i am able to see the video 3 window at the correct coordinates. My problem if i write data into the corresponding registers it is changing the coordinates. This is the data what i am writing

    OSD_VIDWIN1XP(0x58) - 0x320  - to start window at 800 position
    OSD_VIDWIN1YP(0x5C) - 0x1E0 - to start window at 4 position
    OSD_VIDWIN1XL(0x60) - 0x1E0  - size  480 pixels
    OSD_VIDWIN1YL(0x64) - 0x0F    - size as 240


    such that my aim is to display video3 window at bottom corner of the screen (1280x720) . But i am not getting the window at desired positions, it is occupying total 1280x720 screen. How to change the window positions at run time.


    Thanks in advance.

  • venu said:
    Thanks for ur reply. I changed the settings as per mentioned in vpbe user guide under 4.4.23 section by hard coding in  davinci_osd.c , now i am able to see the video 3 window at the correct coordinates.

    means, video window1 is displayed inside video window0 as desired by you? what are the values set in registers in this case?

    venu said:
    My problem if i write data into the corresponding registers it is changing the coordinates. This is the data what i am writing

    when do you change these values. Is it dynamically done(during display)?

    I am trying to understand the scenario better.

    venu said:
    OSD_VIDWIN1YL(0x64) - 0x0F    - size as 240

    I think 0x0F is a typo...

    Also, just try to put video1 window(480x240) at (0,0) (479,239) co-ordinates, it will give idea whether (right, bottom) boundary is the problem.

  • Thanku Nagabhusana,

     

    Ya i am trying to display video window 1 inside video window 0. I changed the coordinates as u mentioned in the last post  for that i  write the values into the registers 0x58,0x5c,0x60,0x64. I think i am not giving the perfect sdram offset value. can u please tell me what is the sdram offset value for DM365 VPBE OSD Register . In davinci_osd.h file they mentioned it as    

     #define DM365_OSD_REG_BASE 0x01C71C00 

    I tried with this  but the same result.  Can u give me clear idea about changing the video window positions and sizes  dynamically  at run time.

     

     

     

  • Hi nagabhusana,

     

    Now i am able to change the video window co-ordinates at run time by writing into the corresponding registers for that i am able to change the position only after displaying. That means first i need to display the data on to the window and then write to the registers.Thanks for ur help.

     

    I have one more query about osdWIN0 , How to increase transperency of fb0 window such that it look like graphics is displaying on top of video window. actually it is visible as video is comming on top of graphics .

  • hey,

    glad that you are progressing with OSD configuration.

    Please mark the answer as verified if you feel my posts have helped you in solving the problem.

    venu said:
    I have one more query about osdWIN0 , How to increase transperency of fb0 window such that it look like graphics is displaying on top of video window.

    OSD window1 can be configured as attribute window to OSD window0.  With this setting, you can control transparency level. VPBE user guide section 4.4.4(section 4.4.4.3 and 4.4.4.8, 5.4.1.2 and fig.69 particularly) will help you in configuring registers to control transparency. Please refer to page #167 for register which needs to be programmed for controlling the transparency for OSD window0. I think BLND0 register filed needs to programmed.

    you might want to refer to archive e-2-e thread about the similar issue- link.

    venu said:
    actually it is visible as video is comming on top of graphics .

    I am not getting what you mean here. A snapshot can help, looks like it is too transparent.

  • Hi Nagabhusana,

     

    The is the snap shot of my dm368 output in which calculator application is running on framebuffer0 and videotestsrc is running on VID1. In this video, the video  is running on top of the framebuffer but my application requires graphics window to be shown on top of video window. How to get this one. And one more thing i am able to configure OSD video window size and coordinates but i am not able to resize the video that is total videotest pattern is not comming on the compressed video window. like vlc player i want to get full video even when decrease the size of the UI. here i am not able to get it with videotest pattern i am getting only part of it. How to resize the total video to fit in the compressed video.

                                                           

  • venu,

    can you please dump VPBE-OSD registers?

    venu said:
    In this video, the video  is running on top of the framebuffer but my application requires graphics window to be shown on top of video window. How to get this one.

    Looks like this not possible. Bitmap(OSD) windows will always get displayed on top of video windows[ section 4.4, VPBE user guide]. It might be because OSD window is too transperent.

    venu said:
    And one more thing i am able to configure OSD video window size and coordinates but i am not able to resize the video that is total videotest pattern is not comming on the compressed video window. like vlc player i want to get full video even when decrease the size of the UI. here i am not able to get it with videotest pattern i am getting only part of it. How to resize the total video to fit in the compressed video.

    what is the size of video window and video frame?

  •  

    Hi nagabhusana,

    These are the OSD-VPBE registers which i changed for video3 window

    for that i am using "readmem" utuility

    readmem 0x01c71c58 = 0x0

    readmem 0x01c71c5c = 0x0

    readmem 0x01c71c60 = 0x500

    readmem 0x01c71c64 = 0x2D0

    These are the default values when i display the video on video3 window by using the following gstreamer command

    gst-launch-0.10  videotestsrc ! video/x-raw-yuv,format=\(fourcc\)UYVY, width=1280, height=720 ! TIDmaiVideoSink videoOutput=DVI videoStd=720P_60 sync=false displayDevice=/dev/video3 displayStd=V4L2 numBufs=4 useUserptrBufs=true accelFrameCopy=false contiguousInputFrame=TRUE

    for this i am getting the following display

    after that i changed the osd values as below

    readmem 0x01c71c60 w 0x2D0 (800)

    readmem 0x01c71c64 w 0x1E0 (480)

    i am getting the following output

     

    That is window is resizing but the video inside the window is not croping.

  • This is happening because VENC is configured for 1280x720. Changing OSD window sizes will not have impact screen size.

    I have few questions.

    What is your exact requirement? Do you want to keep VENC mode - 1280x720 always and you want to change dynamically OSD window sizes?There is scaling and zooming feature on OSD windows you might want to try for rescaling of windows.

     

  • This is happening because VENC is configured for 1280x720. Changing OSD window sizes will not have impact screen size.

    I have few questions.

    What is your exact requirement? Do you want to keep VENC mode - 1280x720 always and you want to change dynamically OSD window sizes?There is scaling and zooming feature on OSD windows you might want to try for rescaling of windows.

     

    Thank's for ur reply,

    My scenario is to use osd graphical window for UI use(always 1280x720). And i want to use Video2 and Video3 windows to display the data comming from decoder and camera respectively, I want that output to be resize display dynamically with respect to the video2/3 window sizes.

  • venu,

    venu said:

    Thank's for ur reply,

    My scenario is to use osd graphical window for UI use(always 1280x720). And i want to use Video2 and Video3 windows to display the data comming from decoder and camera respectively, I want that output to be resize display dynamically with respect to the video2/3 window sizes.

    In that case do you think you can use resizer in VPFE to do necessary resizing of video frames before inputting to display?

    suppose you want to resize video frame of size 1280x720 from decoder/sensor to 800x480 size image, you can do using resizer easily[ off-course you have to take care pitch requirements].

     

     

  • Hai nagabhusana,

    I am using TIDmaiVideoSink to display video output. If i resize the video and display on the TIDmaiVideoSink it is displaying (using 1280x720 video2/3 window) on the middle of the window and remaing window is occupying with black color. Can u suggest me a application to get video output as given in 83 page of VPBE document which is using osd zomming and  scalling  on both windows.

  • Venu,

    I am not aware any apps for OSD scaling/zooming(I am not expert from application/sdk side). I leave this to DMAI experts to answer.

  • DMAI does not support the requested scaling or zooming, you have to implement this feature in your application.

    Thanks

    Brijesh