locked
VisualBrush? I want to paint UI's background by using VisualBrush?

    Question

  • Hi,

    I have two monitors. Windows 8 does support multi-views.

    I have two views and two monitors.

    The first View is for controller and the second view is display in full screen mode then out put to Projector.

    In WPF you can create a MediaElement then paint it to UI's background by using VisualBrush.

    How to accomplish by using Windows 8 App Store?



    Tuesday, September 16, 2014 1:21 PM

Answers

  • Hello,

    Unfortunately I don't know anything about the Smooth Streaming Player Framework and can't comment on its usage.

    There is not an easy way to get frames our of the MediaElement. Theoretically you can write an MFT in C++ / MoCOM and siphon off the uncompressed bits. Getting the bits is very easy but rendering the bits is extremely difficult. You will likely not get acceptable performance due to the fact that the full uncompressed frame will be traveling over the bus and will be stored in main memory. When you go to render the data it will have to be copied out of main memory, sent over the bus and rendered by the hardware. Because of this we do not recommend this approach.

    Using the Media Engine in C++ / Cx will allow the frames to be decoded on the video hardware and remain in video memory as you "copy" the frames to multiple DirectX buffers. This is the recommended way to display the same video stream on multiple Core Windows.

    Thanks,

    James


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

    Tuesday, September 16, 2014 10:47 PM
    Moderator

All replies

  • You can play video in a MediaElement filling the page behind your controls. There is no concept of a video brush.

    Tuesday, September 16, 2014 2:26 PM
    Owner
  • Hi Rob Caplan ,

    Thanks, but seems to not help. I don't get you. I can create two mediaelement then sync he second mediaelement from the first view(Controller) but this is not the right way., It is lagging and x2 download the live smooth streaming file.

    Thanks and Best Regards,

    Weera

    Tuesday, September 16, 2014 7:40 PM
  • Hello Weera,

    Unfortunately there is no easy was to accomplish this in the context of a Windows Store app. This is in part due to the highly optimized video acceleration that the MediaElement uses to render the video using hardware (DXVA).

    That said you can theoretically use the Media Engine and copy the uncompressed bits to multiple Direct3D surfaces. This should allow you to display the same video frame in two different Core Windows. This comes with some added complexity. You will need to use XAML/DirectX interop. You will need to write all of the Media Engine code in C++ / CX. You will also need to make sure the Media Engine is running in "frame server mode".

    Check out the Media Engine sample for more detail on how to use the APIs:

    Media engine native C++ video playback sample

    http://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0

    I hope this helps,

    James 


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

    Tuesday, September 16, 2014 8:34 PM
    Moderator
  • Hi James Dailey - MSFT

    Thanks, I am using Microsoft Platefrom Media Player Framework.

    https://playerframework.codeplex.com/discussions/topics/5343/windows-8-xaml

    There's a number of extension files format.

    If there's a way to take frame from MediaElement that would solve my problem or capture Screen etc.

    Can you confirm me if this way help?

    You will need to use XAML/DirectX interop. You will need to write all of the Media Engine code in C++ / CX

    Thanks and Best Regards,

    Weera

         


    Tuesday, September 16, 2014 9:56 PM
  • Hello,

    Unfortunately I don't know anything about the Smooth Streaming Player Framework and can't comment on its usage.

    There is not an easy way to get frames our of the MediaElement. Theoretically you can write an MFT in C++ / MoCOM and siphon off the uncompressed bits. Getting the bits is very easy but rendering the bits is extremely difficult. You will likely not get acceptable performance due to the fact that the full uncompressed frame will be traveling over the bus and will be stored in main memory. When you go to render the data it will have to be copied out of main memory, sent over the bus and rendered by the hardware. Because of this we do not recommend this approach.

    Using the Media Engine in C++ / Cx will allow the frames to be decoded on the video hardware and remain in video memory as you "copy" the frames to multiple DirectX buffers. This is the recommended way to display the same video stream on multiple Core Windows.

    Thanks,

    James


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

    Tuesday, September 16, 2014 10:47 PM
    Moderator