simple way to render video frame on screen RRS feed

  • Question

  • Hi,

    I am porting our exsting Video VoIP solution on Windows 8, WinRT. I am trying render decoded video frames(YUV) on the display. In win32 code it was just single call to StretchDIBits!

    What is the corresponding API here ?

    When I asked in forums some people suggested me to use DirectX 11. I referred below two links and Invert code of the MediaExtension sample.



    Am I going in right direction?

    Any other simple way to render video frames which I am receiving in real time?

    Can anybody explain me in simple steps which all API's I need to call ?

    Thanks a lot for any help in advance.


    Friday, November 9, 2012 1:49 PM


All replies

  • Hello,

    The easiest way to get video frames rendered on the screen is to use D2D. Instead of calling "StretchDIBits" you call "DrawBitmap". Unfortunately there is a bit of setup overhead that needs to be done to get such a solution up and running.

    Keep in mind that using D2D will not give you full video acceleration. We have numerous special options for rendering video. To get this acceleration you need to use the Media Engine. Using the Media Engine is extremely complex with lots of moving parts. I would recommend that you consider each option carefully and decide what is best for your business.

    Here are links to samples and pages that should give you all you need to know to get started with both options:


    Direct2D Quickstart for Windows 8


    How to Draw a Bitmap


    Media Engine:

    Real-time communication sample


    I hope this helps,


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, November 20, 2012 11:23 PM
  • Thanks for the help. I am able to render the frame.


    Sunday, December 2, 2012 2:25 PM
  • Hi, James:

         I met a performance issue of draw video frame by Direct2D.

         when I update the video frame, we use  ID2D1Bitmap1::CopyFromMemory() function to update bitmap, but this function will spend 16~32ms in Surface device. the memory size is 1366*768*4=4MB.

         How can I improve the performance.



    • Edited by LuXiaoHua Wednesday, June 5, 2013 1:10 AM
    Wednesday, June 5, 2013 1:06 AM