ms-media-foundation

How to run/start a thread at a given time using Media Foundation?

孤街浪徒 提交于 2019-12-04 22:54:44
I am looking for to start a thread at a specified time with Media Foundation. I know that in DirectShow there is a function called by IMediaFilter where tStart is the time value of the reference clock.: Interface::HRESULT Run(REFERENCE_TIME tStart); But in Media Foundation there is no such function that will run or start a thread with a time as a parameter. Is there a solution to do this in Media Foundation? Neither DirectShow or Media Foundation have functionality that matches the question description. Both APIs have methods to start activity immediately following the request. DirectShow's

Problems capturing with Media Foundation & Windows 8 in C++

五迷三道 提交于 2019-12-04 19:22:37
This is going to be my first question in StackOverflow after several days looking for an explanation. Please, be gentle with me for asking because I know my problem is a bit bizarre to be a general problem. I made a MF capture video application, based in the Microsoft example 'CaptureToFile'. It did work on Windows 7 x64. I upgraded to Visual Studio 2013 without problems. Problems arose when I try to put all the development on a Windows 8.1 x64 machine. The app compiles and executes without error, but it's UNABLE to capture samples by using m_pReader->ReadSample() in asynchronous mode; only

decode MPEG1/2 video with Media Foundation

℡╲_俬逩灬. 提交于 2019-12-04 16:45:41
I am using Media Foundation to play videos. On windows 7 some videos encoded with Mpeg1/Mpeg2 PS and Windows Media Player can play them, but Media Foundation does not(I tried to register a stub MPEG1Source but it still does not work). I noticed some of these files could be played with directshow but not Media foundation(can not be open at all). I guess "media player" does not use Media Foundation only? Is it possible to use Media Foundation to play these file? If it is not, how does Media player work? Thanks a lot. P.S. I have read the windows SDK and I registered a "fake" mpeg1 decode and it

MFCreateFMPEG4MediaSink does not generate MSE-compatible MP4

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 16:15:14
I'm attempting to stream a H.264 video feed to a web browser. Media Foundation is used for encoding a fragmented MPEG4 stream ( MFCreateFMPEG4MediaSink with MFTranscodeContainerType_FMPEG4 , MF_LOW_LATENCY and MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS enabled). The stream is then connected to a web server through IMFByteStream . Streaming of the H.264 video works fine when it's being consumed by a <video src=".."/> tag. However, the resulting latency is ~2sec, which is too much for the application in question. My suspicion is that client-side buffering causes most of the latency. Therefore, I'm

IMFTransform interface of Color Converter DSP giving E_INVALIDARG on SetInputType/SetOutputType

独自空忆成欢 提交于 2019-12-04 14:25:28
I'm trying to use Color Converter DMO ( http://msdn.microsoft.com/en-us/library/windows/desktop/ff819079(v=vs.85).aspx ) to convert RBG24 to YV12/NV12 via Media Foundation. I've created an instance of Color Converter DSP via CLSID_CColorConvertDMO and then tried to set the needed input/output types, but the calls always return E_INVALIDARG even when using media types that are returned by GetOutputAvailableType and GetInputAvailableType . If I set the media type to NULL then i get the error that the media type is invalid, that makes sense. I've seen examples from MSDN, where people do the same

Windows Media Foundation using IMFTransform to decode mp4 movie frames to 2D textures

我的梦境 提交于 2019-12-04 09:47:45
I'm trying to decode an mp4 video using Windows Media Foundation classes and converting frames in to 2D textures that can be used by a DirectX shader for rendering. I've been able to read the source stream using MFCreateSourceReaderfromURL and been able to read the media type of the stream which has its major type MFMEdiaType_Video and minor type as MFVideoFormat_H264 as expected. I'm now needing to convert this format in to an RGB format that could be used to initialise a D3D11_TEXTURE2D resource and resource view which can then be passed to a HLSL pixel shader for sampling. I've tired using

Virtual Driver Cam not recognized by browser

自闭症网瘾萝莉.ら 提交于 2019-12-04 05:29:14
问题 I'm playing with the "Capture Source Filter" from http://tmhare.mvps.org/downloads.htm. After registering the ax driver, I'm trying to understand its compatibility across applications that use video sources. For example, Skype recognize it while browsers (Edge, Chrome) don't. I wonder if it's a limitation of the used approach ( DirectShow filter) or it's just a matter of configuration. The purpose of the question is to understand if that approach is still useful or it's better to move on

IKsPropertySet interface is not supported in IMFMediSource

為{幸葍}努か 提交于 2019-12-03 20:30:07
I am porting my Direct Show camera based SDK to MFT. In my old code I have KSProxy interface like IksTopolgy,IKsControl and IKsProperty . IksTopolgy,IKsControl is used to enumerate the property set and IKsProperty to get/set the property value. Now I was trying to same in new code.I am able to enumerate the property i.e following code is supported in MFT. CComPtr<IKsTopologyInfo> ksTopology = NULL; hRet = m_pMediaSource->QueryInterface(&ksTopology); But IKsProperty interface which is used to get/set the property value is not working returning E_NOINTERFACE. hRet = m_pMediaSource-

System.AccessViolationException from unmanaged code?

狂风中的少年 提交于 2019-12-03 19:15:35
问题 I'm writing this library that implements some basic audio player features in C++/CLI via the Media Foundation framework that will be consumed by managed code. I can play audio, stop, pause, etc just fine. For anyone who is not familiar with Media Foundation, the media session posts events that you can handle for notifications. This is done by calling BeginGetEvent on the session object with an IMFAsyncCallback object. The IMFAsyncCallback defines the method Invoke(IMFAsyncResult) that you

Video Recording Hangs on IMFSinkWriter->Finalize();

被刻印的时光 ゝ 提交于 2019-12-03 15:37:32
I have an issue when finalizing a video recording into an .mp4 using Media Foundation where the call to IMFSinkWriter->Finalize(); hangs forever. It doesn't always happen, and can happen on almost any machine (seen on Windows server, 7, 8, 10). Flush() is called on the audio and video streams before hand and no new samples are added between Flush and Finalize . Any ideas on what could cause Finalize to hang forever? Things I've tried: Logging all HRESULT s to check for any issues (was already checking them before proceeding to the next line of code) Everything comes back as S_OK , not seeing