ms-media-foundation

How to change MediaCapture to Byte[]

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:58:21
问题 How to change MediaCapture to byte[] in Windows Store App for Windows 8.1. From lib: Windows.Media.Capture.MediaCapture asd = new Windows.Media.Capture.MediaCapture(); Thans! 回答1: I assume you want to get a byte array from what the camera is seeing at the moment, although it's hard to interpret from your question. There is a sample on the Microsoft github page that is relevant, although they target Windows 10. You may be interested in migrating your project to get this functionality.

Resizing Texture before sending to SinkWriter SharpDX

心已入冬 提交于 2019-12-11 17:32:06
问题 I'm working on Screen recording application. My problem is I need to resize the Texure2d before making sample using CreateDXGISurfaceBuffer. I'm new with Mediafoundation and upon reading the documentation I couldn't find any sample code from the website. I'm using IDXGIOutput1::DuplicateOutput to get the screen texture. Is there a better way to resize the texture without suffering the performance? 回答1: Video Processor MFT can scale your textures. When you use it in Direct3D 11 enabled mode,

Media Foundation vs DirectShow and Media Containers. (WEBM and OGG THEORA)

自闭症网瘾萝莉.ら 提交于 2019-12-11 08:09:55
问题 Why do all the new video/media container formats provide very little support for media foundation and more for DirectShow knowing that DirectShow is dying. 回答1: Because Media Foundation offers inferior feature set and availability to DirectShow. DirectShow is primary API for formats and codecs in Windows, nevertheless Microsoft stopped its development almost 10 years ago. The extensibility of this API is so good, and it is still so well applicable to multimedia tasks and processing. 来源: https

Using IMFSourceReader to open a video file

≡放荡痞女 提交于 2019-12-11 07:56:30
问题 I want to open a video file using IMFSourceReader to access its Frames as IMFSample. In a WinRT C++ Class I send the RandomAccessStream of a video file and use the following code to create an IMFSourceReader object. HRESULT hr = S_OK; ComPtr<IMFSourceReader> pSourceReader; ComPtr<IMFByteStream> spByteStream; if (SUCCEEDED(hr)) { // Initialize the Media Foundation platform. hr = MFStartup(MF_VERSION); hr = MFCreateMFByteStreamOnStreamEx((IUnknown*)InputVideoStream, &spByteStream); ComPtr

How to convert amr files to mp3 using C#

杀马特。学长 韩版系。学妹 提交于 2019-12-11 02:55:18
问题 I am using NAudio MFT to convert different audio formats to MP3. Now i want to convert amr file to MP3 using Naudio MFT. But, when i given amr file as input to MFT, it has thrown following exception "Exception from HRESULT: 0xC00D36C4". Is there any way to achieve this? My C# code: public byte[] ConvertAMRToMP3( ) { var data = new MediaFoundationReader("..\\amr\\test.amr"); MediaFoundationEncoder.EncodeToMP3(data, "..\\test.mp3", 128000); ...... } I am working on windows server 2012 64-bit

Callback from a C++ COM DLL to a C# application

a 夏天 提交于 2019-12-11 01:29:08
问题 This is going to be a long post, as I want to expose you all the steps I tried to make this work :) I have C++ COM dll which contains a VideoPlayer class which uses the Media Foundation API to display a video. The VideoPlayer class is defined using an IDL file: [ object, uuid(74FDBBB1-BFFB-4F7E-ACA3-ADB0C7232790), dual, nonextensible, pointer_default(unique) ] interface IVideoPlayer : IDispatch { [id(1)] HRESULT Initialize([in] HWND* video_hwnd, [in] HWND* event_hwnd); [id(2)] HRESULT OpenUrl

can't add audio stream to MP4 file using sinkwriter from Media Foundation

喜你入骨 提交于 2019-12-10 23:37:17
问题 It's been a week since I'm trying to make my encoder works... So the things is: I create a file using the Sink Writer from MF. I write all my video sample. --> (If I stop there and call the Finish methods, I'm able to read the file using VLC but if I do the bellow stuff, the file will be "corrupted") I write all my audio sample. I call the finish function and I get a HRESULT code saying: "Sink could not create valid output file because required headers were not provided to the sink". I

Play audio from file to speaker with Media Foundation

假装没事ソ 提交于 2019-12-10 11:45:55
问题 I'm attempting to play the audio track from an mp4 file to my speaker. I know Media Foundation is able to decode the audio stream as I can play it with the TopoEdit tool. In the sample code below I'm not using a media session or topology. I'm attempting to manually connect the media source to the sink writer. The reason I want to do this is that I ultimately intend to be getting the source samples from the network rather than from a file. The error I get on the pSinkWriter->WriteSample line

About “Using DirectShow filters outside DirectShow?”

南楼画角 提交于 2019-12-10 10:41:25
问题 I have exactly the same question in the following link, Using DirectShow filters outside DirectShow? I am a fresh to direct show and the two answers in that stack is not clear enough to me. And I can not find a way to contact with the author to ask if he solved his problem. Is there a way to do this? Or, could some one give more detail explain about these two answers? What does it means about " "by hand" call the various filter " and what does it means about "wrap the entire filter graph"?

How to take a still photo in either DirectShow or Media Foundation

◇◆丶佛笑我妖孽 提交于 2019-12-10 09:28:02
问题 Is there a way to make a photo (still image) with either DirectShow or Media Foundation APIs? I got video capture working and I can just capture the very first frame and call it a day, but that's not what a photo is. Usually cameras have distinct video and photo modes, where photo mode allows for a lot greater resolution. For example, I have Logitech HD Pro Webcam C920 and it claims to allow to do 15mp photos. The software that came with it takes 5168x2907 photo images. So far I haven't seen