locked
Feeding the IMFMediaEngine from the IMFMediaSource

    Question

  • I’m working with live feeds from a HD webcam (compressed stream) and would like to render the decoded live feed to a Direct2D / Direct3D 11.X surface.

    It seems like the IMFMediaEngine might be a good pick for this task. I’ve even stumbled upon a post here that mentioned such use case:


    Unfortunately the interface of the IMFMediaEngine(Ex) accepts only either a URL or a IMFByteStream as a media source.

    Do you have any advices on how to feed the IMFMediaEngine from a IMFMediaSource ?

    What could be the alternative approach for rendering of a HD webcam live feed to a Direct3D 11.X / Direct2D surface ?

    Tomek


    Monday, July 23, 2012 4:15 PM

Answers

  • Hello Tomasz,

    At this time the "media engine" does not support media capture. You will need to use the "media capture engine". Unfortunately with the "media capture engine" you cannot easily supply your own D3D surface. The best way to achieve this is to write a custom sink and pass your custom sink the D3D surface that you want to use. You can then blt the data onto your surface from the context of the custom sink. The "real time communication" sample might help to get you started.

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

    I hope this helps,

    James 


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

    Wednesday, July 25, 2012 1:13 AM
    Moderator