daldegam
Topic Author
Posts: 10
Joined: 17 Jan 2020, 14:54

MediaElement - Compatibility

09 Nov 2022, 14:29

Hey,
I have some doubts about MediaElement compatibility.

First, I'm using "Samples.VideoEffect.exe" but I modified the xaml to make it as simple as possible.

How I left:
<Window x:Class="VideoEffect.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
  xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
  xmlns:local="clr-namespace:VideoEffect"
  Title="NoesisGUI - VideoEffect"
  d:DesignWidth="1280" d:DesignHeight="720">

  <Window.Resources>
    <LinearGradientBrush x:Key="TextBg" StartPoint="0,0" EndPoint="0,1">
      <GradientStop Offset="0" Color="#004040"/>
      <GradientStop Offset="0.5" Color="Gray"/>
      <GradientStop Offset="1" Color="#402040"/>
    </LinearGradientBrush>
  </Window.Resources>
  <Grid x:Name="LayoutRoot">
        <Border x:Name="vidbd">
            <MediaElement x:Name="vid" Source="Particles.mp4" Stretch="UniformToFill" LoadedBehavior="Manual">
                <b:Interaction.Triggers>
                    <b:EventTrigger EventName="Loaded">
                        <noesis:PlayMediaAction/>
                    </b:EventTrigger>
                    <b:EventTrigger EventName="MediaEnded">
                        <noesis:StopMediaAction/>
                        <noesis:PlayMediaAction/>
                    </b:EventTrigger>
                </b:Interaction.Triggers>
            </MediaElement>
        </Border>
    </Grid>

</Window>
On my computer (Win11), when I use:
--render gl = open a black screen
--render d3d11 = works normally
--render d3d12 = crash

I created a VM with Win10:
--render gl = open a black screen
--render d3d11 = crash
--render d3d12 = my vm doesn't support DX12.

Does MediaElement support OpenGL?
The fact that D3D11 crashes in a VM would be for what reason? (apparently I tested it on other computers with VM and the same crash happened)

Thanks.
 
daldegam
Topic Author
Posts: 10
Joined: 17 Jan 2020, 14:54

Re: MediaElement - Compatibility

09 Nov 2022, 14:44

I used the visual studio remote debug on the Windows 10 VM to try to see what the D3D11 error is.

My output debug is:
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Noesis\Samples.VideoEffect.exe'. Symbols loaded.
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Noesis\Noesis.dll'. Symbols loaded.
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Noesis\vcruntime140d.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Noesis\ucrtbased.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Noesis\NoesisApp.dll'. Symbols loaded.
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. 
'Samples.VideoEffect.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ucrtbase.dll'
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. 
'Samples.VideoEffect.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DWrite.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. 
[NOESIS/I] Noesis Init v3.1.5 (Windows on x86 Profile)
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mswsock.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\MMDevAPI.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\AudioSes.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\umpdc.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ResourcePolicyClient.dll'. 
[NOESIS/D] Creating 'WASAPI' audio device: Speakers (High Definition Audio Device)
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\XInput1_4.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\InputHost.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\propsys.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'. 
[NOESIS/I] '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Colors.Dark.xaml' loaded
[NOESIS/I] '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Brushes.DarkBlue.xaml' loaded
[NOESIS/I] '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Fonts.xaml' loaded
[NOESIS/I] '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Styles.xaml' loaded
[NOESIS/I] '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml' loaded
[NOESIS/I] 'App.xaml' loaded
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d11.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dxgi.dll'. 
[NOESIS/D] Creating D3D11 render context
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DXGIDebug.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vm3dum_loader.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wldp.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vm3dum_10.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d11_3SDKLayers.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DXCore.dll'. 
[NOESIS/D]  Feature Level: 11_0
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dcomp.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. 
[NOESIS/D]  Adapter: VMware SVGA 3D
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfplat.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\RTWorkQ.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfreadwrite.dll'. 
[NOESIS/I] 'MainWindow.xaml' loaded
[NOESIS/I] 'Particles.mp4' loaded
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d10level9.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vm3dum.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CompPkgSup.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.Media.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.ApplicationModel.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinapi.appcore.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\AppXDeploymentClient.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.StateRepositoryPS.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfmp4srcsnk.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msmpeg2vdec.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptsp.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfperfhelper.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mfcore.dll'. 
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ksuser.dll'. 
Exception thrown at 0x768BDF72 in Samples.VideoEffect.exe: Microsoft C++ exception: _com_error at memory location 0x014FDF6C.
Exception thrown at 0x768BDF72 (KernelBase.dll) in Samples.VideoEffect.exe: WinRT originate error - 0xC00D36B3 : 'The stream number provided was invalid.'.
D3D11 ERROR: ID3D11Device::CreateTexture2D: The format (0x67, NV12) cannot be bound as a ShaderResource or cast to a format that could be bound as a ShaderResource. Therefore this format cannot support D3D11_BIND_SHADER_RESOURCE. [ STATE_CREATION ERROR #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT]
Exception thrown at 0x768BDF72 in Samples.VideoEffect.exe: Microsoft C++ exception: _com_error at memory location 0x014FE888.
D3D11 ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN]
'Samples.VideoEffect.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avrt.dll'. 
Exception thrown: read access violation.
this->**mD3D11MediaPlayerVideoTexture** was nullptr.

And the callstack is:
>	NoesisApp.dll!NoesisApp::D3D11MediaPlayer::TextureRender(Noesis::RenderDevice * device=0x055c9bd8) Line 1058	C++
 	NoesisApp.dll!NoesisApp::D3D11MediaPlayer::TextureRenderCallback(Noesis::RenderDevice * device=0x055c9bd8, void * user=0x057ce4b0) Line 992	C++
 	Noesis.dll!Noesis::DynamicTextureSourceProxy::Render(Noesis::RenderDevice * device=0x055c9bd8) Line 37	C++
 	Noesis.dll!Noesis::RenderTree::RenderOffscreen(const Noesis::Matrix4 & projection={...}) Line 285	C++
 	Noesis.dll!Noesis::Renderer::RenderOffscreen(const Noesis::Matrix4 & projection={...}) Line 173	C++
 	Noesis.dll!Noesis::Renderer::RenderOffscreen() Line 151	C++
 	NoesisApp.dll!NoesisApp::Window::Render(double time=1.9999999999999999e-07) Line 220	C++
 	NoesisApp.dll!NoesisApp::Application::Tick(double time=1.9999999999999999e-07) Line 217	C++
 	NoesisApp.dll!NoesisApp::ApplicationLauncher::OnTick(double time=1.9999999999999999e-07) Line 116	C++
 	NoesisApp.dll!NoesisApp::DisplayLauncher::Run::__l2::<lambda_1>::operator()(NoesisApp::Display * __formal=0x017ef6f0) Line 43	C++
 	NoesisApp.dll!Noesis::Delegate<void __cdecl(NoesisApp::Display *)>::FunctorStub<`NoesisApp::DisplayLauncher::Run'::`2'::<lambda_1>>::Invoke(NoesisApp::Display * <args_0>=0x017ef6f0) Line 432	C++
 	NoesisApp.dll!Noesis::Delegate<void __cdecl(NoesisApp::Display *)>::operator()(NoesisApp::Display * <args_0>=0x017ef6f0) Line 172	C++
 	NoesisApp.dll!NoesisApp::Win32Display::DispatchEvent(unsigned int msg=15, unsigned int wParam=0, long lParam=0) Line 1072	C++
 	NoesisApp.dll!NoesisApp::Win32Display::WndProc(HWND__ * hWnd=0x00060220, unsigned int msg=15, unsigned int wParam=0, long lParam=0) Line 1382	C++
 
User avatar
jsantos
Site Admin
Posts: 3905
Joined: 20 Jan 2012, 17:18
Contact:

Re: MediaElement - Compatibility

14 Nov 2022, 16:36

Right now, MediaElement is only implemented in D3D11, D3D12, PlayStation and Nintendo Switch. OpenGL is not supported right now.

For D3D11, we need the NV12 yuv pixel format, I think under your VM that format is not supported. We should detect this and avoid crashing.

Could you please paste the error + callstack you have in D3D12?

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], vinick and 17 guests