ms-media-foundation

Mediafoundation cant decode video on certain NVIDIA cards

时光总嘲笑我的痴心妄想 提交于 2021-02-20 04:36:26
问题 We are using the SharpDX .NET wrapper to make Mediafoundation decode an MP4 Video into a DirectX9 texture. This works fine, except that it crashes on certain NVIDIA cards for example the 940MX . For example the same machine with an Intel HD graphics card decodes the video stream fine. Unfortunately we cant get any other details than a E_FAIL/Unspecified error from SharpDX . Even with the debug layer enabled. Any ideas how to find out why it crashes? VideoMediaType outputVideoFormat;

How to get a SourceReader to decompress frames and send them to a Direct3D9 texture?

时光总嘲笑我的痴心妄想 提交于 2021-02-18 18:56:39
问题 I am trying to get a MediaFoundation SourceReader to read an H.264 video file, and render the frames to some Direct3D textures so I can them render them as I wish with Direct3D. I'm using SharpDX, but the principles are of course the same as native code. As I understand it, the general data flow should be like this: A SourceReader reads and decodes the video using SourceReader.ReadSample() A VideoProcessor (from IDirect3DDeviceManager9 ) transfers the frame to a Direct3D9 surface using

Setup of IMTransform Video Processor for color space conversion

荒凉一梦 提交于 2021-02-10 12:44:16
问题 I am trying to do some basic color space conversion using Video Processor MFT. My camera natively supports NV12 and I need RGB24, to code some shader which will provide cartoon-like effect. Here is definition of class Media which is used to perform MF. class Media : public IMFSourceReaderCallback //this class inhertis from IMFSourceReaderCallback { CRITICAL_SECTION criticalSection; long referenceCount; WCHAR *wSymbolicLink; UINT32 cchSymbolicLink; IMFSourceReader* sourceReader; MFT_REGISTER

Can't set the output type on an HEVC decoder IMFTransform

微笑、不失礼 提交于 2021-02-10 05:30:50
问题 I've written this program to setup an HEVC decoder based on https://docs.microsoft.com/en-us/windows/win32/medfound/supporting-direct3d-11-video-decoding-in-media-foundation. Everything works fine until the end when I call result = decoder->SetOutputType(0, media_type, 0); this returns the error MF_E_ATTRIBUTENOTFOUND . I'm not sure what's wrong, this error isn't described in the SetOutputType documentation and I've only found a couple examples of HEVC decoding with MF and none of them

Poor performance on H264 decoding

坚强是说给别人听的谎言 提交于 2021-02-08 11:25:50
问题 I'm decoding a H264 video stream using Media Foundation. It works, but performance is really poor on both Windows (desktop) and HoloLens 2 (UWP). Decoding a single 1920x1080 frame takes 30 ms on a fairly powerful PC, 100 ms on the HoloLens . I'm wondering if it's using software rendering instead of hardware rendering. Any idea on how to make sure that I'm doing hardware decoding, or any other hints on how to improve performance? The code is as follows: Decode.cpp: #include "MFUtility.h"

Is it possible to shut down a D3D device?

旧时模样 提交于 2021-02-08 10:20:29
问题 I have a test that shows memory leak in my app: RAM usage increases 30-40MB per iteration, the profiler shows it’s in external code. Between the iterations, I shut down & then recreate D3D device. When I stopped doing that and just kept the device alive, it became good: The only difference is 2 interface pointers: ID3D11Device , and IMFDXGIDeviceManager . Is there a way to shutdown a D3D device so it releases the memory instead of leaking? As far as I understand, if I would have leaked a

Is it possible to shut down a D3D device?

最后都变了- 提交于 2021-02-08 10:19:23
问题 I have a test that shows memory leak in my app: RAM usage increases 30-40MB per iteration, the profiler shows it’s in external code. Between the iterations, I shut down & then recreate D3D device. When I stopped doing that and just kept the device alive, it became good: The only difference is 2 interface pointers: ID3D11Device , and IMFDXGIDeviceManager . Is there a way to shutdown a D3D device so it releases the memory instead of leaking? As far as I understand, if I would have leaked a

Programmatically set Graphics Performance for an app

丶灬走出姿态 提交于 2021-02-07 04:20:57
问题 There is an option in Windows control panel that allows to set a app to "high performance". Control Panel -> System -> Display -> Graphics Settings. On adding my application there, I noticed that, when encoding with Media Foundation and H.265 it uses the NVIDIA gfx adapter for encoding. Before that, it used to use the embedded Intel graphics which would only do H.264 encoding, so H.265 encoding was slowly done in CPU. How can I add my application there programmatically? It's crucial for my

Programmatically set Graphics Performance for an app

谁说胖子不能爱 提交于 2021-02-07 04:17:57
问题 There is an option in Windows control panel that allows to set a app to "high performance". Control Panel -> System -> Display -> Graphics Settings. On adding my application there, I noticed that, when encoding with Media Foundation and H.265 it uses the NVIDIA gfx adapter for encoding. Before that, it used to use the embedded Intel graphics which would only do H.264 encoding, so H.265 encoding was slowly done in CPU. How can I add my application there programmatically? It's crucial for my

Programmatically set Graphics Performance for an app

做~自己de王妃 提交于 2021-02-07 04:16:24
问题 There is an option in Windows control panel that allows to set a app to "high performance". Control Panel -> System -> Display -> Graphics Settings. On adding my application there, I noticed that, when encoding with Media Foundation and H.265 it uses the NVIDIA gfx adapter for encoding. Before that, it used to use the embedded Intel graphics which would only do H.264 encoding, so H.265 encoding was slowly done in CPU. How can I add my application there programmatically? It's crucial for my