ms-media-foundation

How to send IMFSample to EVR Media Sink

梦想的初衷 提交于 2019-12-01 07:24:39
问题 I want to use EVR standalone, but i failed sending IMFSample to it. codes list below, //create the video render IMFActivate* pActive = NULL; hr = MFCreateVideoRendererActivate(m_hWnd, &pActive); CHECK_HR(hr); hr = pActive->ActivateObject(IID_IMFMediaSink,(void**)&m_pVideoSink) ; CHECK_HR(hr); hr = m_pVideoSink->GetStreamSinkByIndex(0,&m_pVideoStreamSink) ; CHECK_HR(hr); //on Sample ready from a custom mft hr = m_pVideoStreamSink->ProcessSample(pSample) ; then i got an E_NOTIMPL error. After

IMFSinkWriter can't export a large size video of mp4

冷暖自知 提交于 2019-12-01 07:02:06
问题 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

best way to build graph for MPEG2 transport stream

怎甘沉沦 提交于 2019-11-30 23:33:57
on windows 7 the windows media player supports .ts files very well, in the sense that windows media player knows how to handle such files without any additional codec packs. however if I try to use graphedit to "render" a .ts file, it complains it doesnt know how to build a graph for it. what method does windows media player use to demux/decode these files? is it directshow? windows media foundation? BDA? Microsoft TV Technologies? unified tuning model? whatever the method they use, is available as an API to be used in my custom application? In DirectShow using only Microsoft filters it can be

Get all supported FPS values of a camera in Microsoft Media Foundation

痴心易碎 提交于 2019-11-30 22:24:00
I want to get a list of all FPS values that my webcam supports. In How to Set the Video Capture Frame Rate msdn article it says that I can query the system for maximum and minimum supported FPS of a particular camera. It also says: The device might support other frame rates within this range. And in MF_MT_FRAME_RATE_RANGE_MIN it says: The device is not guaranteed to support every increment within this range. So it sounds like there is no way to get all of the supported FPS values by the camera in Media Foundation, just the max and min. I know that on Linux v4l2-ctl --list-formats-ext command

MF SinkWriter Write Sample Failed

允我心安 提交于 2019-11-30 10:38:31
I'm trying to encode the ID3D11Texture2D to mp4 using MediaFoundation. Below is my current code. Initializing Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_LOW_LATENCY, 1); /

System.AccessViolationException from unmanaged code?

夙愿已清 提交于 2019-11-30 07:46:26
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 should implement to handle the events. When an event occurs, the invoke method is called by the session

MF SinkWriter Write Sample Failed

拥有回忆 提交于 2019-11-29 16:30:43
问题 I'm trying to encode the ID3D11Texture2D to mp4 using MediaFoundation. Below is my current code. Initializing Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE

Whole screen capture and render in DirectX [PERFORMANCE]

大兔子大兔子 提交于 2019-11-29 07:42:08
I need some way to get screen data and pass them to DX9 surface/texture in my aplication and render it at at least 25fps at 1600*900 resolution, 30 would be better. I tried BitBliting but even after that I am at 20fps and after loading data into texture and rendering it I am at 11fps which is far behind what I need. GetFrontBufferData is out of question. Here is something about using Windows Media API , but I am not familiar with it. Sample is saving data right into file, maybe it can be set up to give you individual frames, but I haven't found good enough documentation to try it on my own. My

Whole screen capture and render in DirectX [PERFORMANCE]

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:01:33
问题 I need some way to get screen data and pass them to DX9 surface/texture in my aplication and render it at at least 25fps at 1600*900 resolution, 30 would be better. I tried BitBliting but even after that I am at 20fps and after loading data into texture and rendering it I am at 11fps which is far behind what I need. GetFrontBufferData is out of question. Here is something about using Windows Media API , but I am not familiar with it. Sample is saving data right into file, maybe it can be set

Windows Media Foundation recording audio

本秂侑毒 提交于 2019-11-27 15:42:34
I'm using the windows media foundation api to enumerate both my microphones and available cameras, which both work. Here is my enumeration code: class deviceInput { public: deviceInput( REFGUID source ); ~deviceInput(); int listDevices(bool refresh = false); IMFActivate *getDevice(unsigned int deviceId); const WCHAR *getDeviceName(unsigned int deviceId); private: void Clear(); HRESULT EnumerateDevices(); UINT32 m_count; IMFActivate **m_devices; REFGUID m_source; }; deviceInput::deviceInput( REFGUID source ) : m_devices( NULL ) , m_count( 0 ) , m_source( source ) { } deviceInput::~deviceInput()