locked
simple way to render video frame on screen

    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.

    http://www.rastertek.com/dx11tut22.html

    http://www.braynzarsoft.net/index.php?p=D3D11RTT

    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.


    a

    Friday, November 9, 2012 1:49 PM

Answers

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:

    Direct2D Quickstart for Windows 8

    http://msdn.microsoft.com/en-us/library/hh780340(v=vs.85).aspx

    How to Draw a Bitmap

    http://msdn.microsoft.com/en-us/library/dd756684(v=vs.85).aspx

    Media Engine:

    Real-time communication sample

    http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290

    I hope this helps,

    James


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

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

    a

    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.

    Thanks!

    Thanks!


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