ms-media-foundation

“Class not registered” when loading the Video Processor MFT on Windows 7

早过忘川 提交于 2020-04-16 02:59:09
问题 I have the following COM call: IMFTransform* pMFT = NULL; HRESULT hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pMFT)); On my development machine, this call to CoCreateInstance succeeds. However, when I deploy this on my old Windows 7 machine, the call to CoCreateInstance fails, and I don't know why. Here's how I'm displaying the error: _com_error err(hr); LPCTSTR hrErrMsg = err.ErrorMessage(); WCHAR msg[MAX_PATH]; StringCbPrintf(msg, sizeof(msg), L

Media Foundation EVR no video displaying

旧时模样 提交于 2020-02-20 10:32:51
问题 I've been trying in vain to come up with a no frills example of displaying video using Microsoft's Media Foundation Enhanced Video Renderer (EVR). I'm testing on Windows 7 with Visual Studio 2013. I'm pretty sure I've got the media types configured correctly as I can export and save the buffer from the IMFSample in my read loop to a bitmap. I can also get the video to render IF I get MF to automatically generate the topology but in this case I need to wire up the source reader and sink writer

Set attributes via ICodecAPI for a H.264 IMFSinkWriter Encoder

北城以北 提交于 2020-02-02 06:12:14
问题 I am trying to tweak the attributes of the H.264 encoder created via ActivateObject() by retrieving the ICodecAPI interface to it. Although I do not get errors, my settings are not taken into account. Code runs under Windows 10. I copy the code I use to create the IMFSinkWriter and retrieve the ICodecAPI below. Error handling not shown, but no error are produced. I have read this thread which implies that tweaking the encoder used by IMFSinkWriter may not be possible, but since there's no

Set attributes via ICodecAPI for a H.264 IMFSinkWriter Encoder

和自甴很熟 提交于 2020-02-02 06:11:09
问题 I am trying to tweak the attributes of the H.264 encoder created via ActivateObject() by retrieving the ICodecAPI interface to it. Although I do not get errors, my settings are not taken into account. Code runs under Windows 10. I copy the code I use to create the IMFSinkWriter and retrieve the ICodecAPI below. Error handling not shown, but no error are produced. I have read this thread which implies that tweaking the encoder used by IMFSinkWriter may not be possible, but since there's no

Color conversion from DXGI_FORMAT_B8G8R8A8_UNORM to NV12 in GPU using DirectX11 pixel shaders

陌路散爱 提交于 2020-01-29 04:51:06
问题 I'm working on a code to capture the desktop using Desktop duplication and encode the same to h264 using Intel hardwareMFT. The encoder only accepts NV12 format as input. I have got a DXGI_FORMAT_B8G8R8A8_UNORM to NV12 converter(https://github.com/NVIDIA/video-sdk-samples/blob/master/nvEncDXGIOutputDuplicationSample/Preproc.cpp) that works fine, and is based on DirectX VideoProcessor. The problem is that the VideoProcessor on certain intel graphics hardware supports conversions only from DXGI

Encoding a D3D Surface obtained through Desktop Duplication using Media Foundation

喜夏-厌秋 提交于 2020-01-28 06:20:58
问题 I want to encode Desktop Duplication API frames to send over the network after encoding them with Media Foundation. I'm stuck with a E_NOTIMPL error when I call IMFTransform::ProcessInput, leaving me a little in the dark. These are the steps I've done up until now, I'm detailing them because it took me days to gather everything from the scarce scattered info across the web, so if it's resolved it will hopefully help others. Everything below is met with an S_OK: I'm obtaining the surface

Encoding a D3D Surface obtained through Desktop Duplication using Media Foundation

China☆狼群 提交于 2020-01-28 06:16:07
问题 I want to encode Desktop Duplication API frames to send over the network after encoding them with Media Foundation. I'm stuck with a E_NOTIMPL error when I call IMFTransform::ProcessInput, leaving me a little in the dark. These are the steps I've done up until now, I'm detailing them because it took me days to gather everything from the scarce scattered info across the web, so if it's resolved it will hopefully help others. Everything below is met with an S_OK: I'm obtaining the surface

How to change Media Foundation Transform output frame(video) size?

懵懂的女人 提交于 2020-01-15 15:38:09
问题 I am writing a transform and want to change the output size of the frame and video. I inspected the sample and found out the order of function calling: SetInputType SetOutputType GetInputCurrentType SetInputType UpdateFormatInfo GetOutputCurrentType SetOutputType GetOutputStreamInfo SetProperties ProcessOutput (THROW NEED INPUT) ProcessInput ProcessOutput ProcessOutput (THROW .... .... repeat until done In which step do I need to modify the output size and how? Example: Input a 640x480 video,

How to get an IMFTransform that is d3d_aware (To encode input from Windows Duplication API to H264)?

会有一股神秘感。 提交于 2020-01-14 05:34:33
问题 The next code should give inputInfo and outputInfo configuration to get a IMFTransform back, and this IMFTransform be used to encode ID3D11Texture2D(with format DXGI_FORMAT_B8G8R8A8_UNORM) to H264 I understand the format DXGI_FORMAT_B8G8R8A8_UNORM can be taken as a MFVideoFormat_NV12 on a IMFTranform that is D3D_AWARE . But i'm having problems to get a IMFTranform that is D3D_AWARE MFT_REGISTER_TYPE_INFO inputInfo = { MFMediaType_Video, MFVideoFormat_NV12 }; MFT_REGISTER_TYPE_INFO outputInfo

Why does MediaElement sometimes silently fail and how can I correct it?

故事扮演 提交于 2020-01-13 10:27:07
问题 In my WPF project I have created a view that includes several MediaElements playing videos. Sometimes, anywhere between one or all of the MediaElements will fail to play the video assigned to them, and will instead show a black rectangle, or not appear at all. The MediaFailed event does not occur when this happens. The MediaOpened event DOES get raised on all the MediaElements, even when they do not play the video. I have installed the latest drivers for my graphics card and that has had no