ms-media-foundation

IMFActivate::ActivateObject return error code “CoInitialize has not been called.”

為{幸葍}努か 提交于 2019-12-02 02:41:03
I'm writing a simple multimedia application in Visual Studio 2013 and I need to enumerate camera devices connected to my computer and create a media source object to link to one of them. I use Media Foundation SDK and tried to run the guide here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd940326(v=vs.85).aspx : #include <Mfapi.h> #include <mfidl.h> #include <mfobjects.h> #include <iostream> #pragma comment(lib, "Mfplat") #pragma comment(lib, "Mf") template <class T> void SafeRelease(T **ppT) { if (*ppT) { (*ppT)->Release(); *ppT = NULL; } } HRESULT CreateVideoDeviceSource

Multiple input MFT in Microsoft Media Foundation

独自空忆成欢 提交于 2019-12-02 02:05:47
问题 I'm struggling with mixing two audio streams into single output stream. MFNode has an AudioMixerMFT but TopoEdit crashes when I try to build a topology like this & execute it: Note: I tried TopoEdit that comes with Windows SDK 7.1 & also the one with few fixes by the author of "Developing Microsoft® Media Foundation Applications" I thought it could be some issue with TopoEdit so I built the Topology in code (by modifying the code from Ch#9 of "Developing Microsoft® Media Foundation

How to play IMFMediaSample in media foundation?

大城市里の小女人 提交于 2019-12-02 02:04:57
问题 I am able to extract samples out of a video using the readSample method. Now how can I play the data present in those samples? Or how to play IMFSample ? 回答1: Sample IMFSample is a block of data, such as video frame or a chunk of audio sequence. This is a tiny piece of data to be played alone. The API addresses more sophisticated playback scenarios, such as where playback is a session where one or more streams are streamed in sync. Be sure to check Getting Started with MFPlay on MSDN to see

How to play IMFMediaSample in media foundation?

二次信任 提交于 2019-12-02 01:39:59
I am able to extract samples out of a video using the readSample method. Now how can I play the data present in those samples? Or how to play IMFSample ? Sample IMFSample is a block of data, such as video frame or a chunk of audio sequence. This is a tiny piece of data to be played alone. The API addresses more sophisticated playback scenarios, such as where playback is a session where one or more streams are streamed in sync. Be sure to check Getting Started with MFPlay on MSDN to see how playback is set up with Media Foundation. 来源: https://stackoverflow.com/questions/9719338/how-to-play

MFT Encoder (h264) High CPU utilization

ⅰ亾dé卋堺 提交于 2019-12-01 22:04:24
I am able successfully to encode the data by H264 using Media Foundation Transform (MFT) but unfortunately I got a very high CPU(when I comment in the program the calling of this function I got low CPU).It is few steps followed to get the encoding so I can't do anything to improve it?Any idea can help HRESULT MFTransform::EncodeSample(IMFSample *videosample, LONGLONG llVideoTimeStamp, MFT_OUTPUT_STREAM_INFO &StreamInfo, MFT_OUTPUT_DATA_BUFFER &encDataBuffer) { HRESULT hr; LONGLONG llSampleDuration; DWORD mftEncFlags, processOutputStatus; //used to set the output sample IMFSample

Media Foundation IMFSinkWriter::Finalize() method fails under Windows 7 when muxing H.264 frames into MP4

梦想的初衷 提交于 2019-12-01 11:24:39
I'm writing a tool in C# that muxes H.264 frames into MP4 files, and I'm using Media Foundation's media sink with sink writer to do this. Things work pretty well under Win8, but under Windows 7 the same code throws an exception, HResult: 0xC00D36E6 (MF_E_ATTRIBUTENOTFOUND), when invoking sink writer's Finalize method. As a result, the generated MP4 file is not properly closed, and is (of course) not playable. The mftrace log shows that the failure under Windows 7 occurs somewhere after (or during) the internal call to IMFSinkWriter::PlaceMarker. Under Windows 8 the corresponding line in the

How to get a list of all Microsoft Media Foundation Transforms (MFTs) available on a system

北城余情 提交于 2019-12-01 11:05:52
I'm a newbie to native development on Windows, but I've been tasked with creating a small app that will list out all the transformers for various video+audio codecs. Looking at the MSDN documentation, there doesn't seem to be much direct documentation on doing this. Docs that I've found indicate that this information is stored in the registry (not sure where) so that could be a vector. Is this possible? Generally how should I do it? Thanks EDIT: It does seem that a call to MFTEnumEx with the parameters of type MFT_REGISTER_TYPE_INFO set to NULL returns a count of 8 MFTEnumEx(MFT_CATEGORY_VIDEO

IMFSinkWriter can't export a large size video of mp4

只谈情不闲聊 提交于 2019-12-01 09:24:17
My Windows MFC application has a function to export a video file. And it can select encoding format (via WMV or MP4 ) and frame size. But, Unfortunately when i tried to export MP4 file which is set large frame size, everytime MF_E_INVALIDMEDIATYPE happened. Simply put, here is the result when i tested in each case. WMV 640 x 480 ... OK 640 x 576 ... OK 1280 x 720 ... OK 1280 x 720 ... OK 1920 x 1080 ... OK 2048 x 1556 ... OK 4096 x 2160 ... OK MP4 640 x 480 ... OK 640 x 576 ... OK 1280 x 720 ... OK 1280 x 720 ... OK 1920 x 1080 ... OK 2048 x 1556 ... MF_E_INVALIDMEDIATYPE 4096 x 2160 ... MF_E

How to get a list of all Microsoft Media Foundation Transforms (MFTs) available on a system

岁酱吖の 提交于 2019-12-01 09:11:16
问题 I'm a newbie to native development on Windows, but I've been tasked with creating a small app that will list out all the transformers for various video+audio codecs. Looking at the MSDN documentation, there doesn't seem to be much direct documentation on doing this. Docs that I've found indicate that this information is stored in the registry (not sure where) so that could be a vector. Is this possible? Generally how should I do it? Thanks EDIT: It does seem that a call to MFTEnumEx with the

Webcam MJPG capture streams are unavailable on Windows 10

喜你入骨 提交于 2019-12-01 08:40:16
问题 On Windows 10 build 10.1607.14393.10 (aka Anniversary edition) I am unable to get MJPG capture streams anymore. Used to be both MJPG and YUY2 resolutions, now I am getting only YUY2 in DirectShow (Kernel Streaming) and in Media Foundation MJPG converted media types into NV12 way before IBaseFilter source is connected to anything. Tried on multiple systems with different cameras. Any ideas what might be wrong? 640x480 @30 YUY2 ... 640x480 @30 MJPG <- gone ... DirectShow: com_t<IAMStreamConfig>