ms-media-foundation

Color Converter DSP ProcessOutput always returns MF_E_TRANSFORM_NEED_MORE_INPUT

点点圈 提交于 2021-02-06 09:27:31
问题 I need to convert video frames from RGB32 to IYUV but the Color Converter MFT refuses to process samples. For every frame I call IMFTransform::ProcessInput() and IMFTransform::ProcessOutput() but I receive MF_E_TRANSFORM_NEED_MORE_INPUT . If I try to feed MFT with another sample i get the MF_E_NOTACCEPTING error. Below I paste a code to show my problem. Hopefully you guys will be able to help. First I create Media types: //DSP input MediaType CHECK_HR(hr = MFCreateMediaType(&m_pInputMediaType

Windows media foundation enumerating Camera devices

江枫思渺然 提交于 2021-02-05 07:44:56
问题 I would like to enumerate the camera devices on my computer using Windows Media Foundation, I used the code on Microsoft : http://msdn.microsoft.com/en-us/library/windows/desktop/dd940326(v=vs.85).aspx I reproduced the same code they use here : http://msdn.microsoft.com/en-us/library/windows/desktop/ee663604(v=vs.85).aspx When I used their code I get my webcam device name, however my code doesn't find any camera capture device. I'm enable to find why. Here is the code : #pragma once #include

How to specify language list object in Windows Media Foundation SDK

旧城冷巷雨未停 提交于 2021-01-29 08:52:54
问题 Currently I'm trying to use Windows Media Foundation SDK (C++) to create WMV file on Windows 10. I was able to create a WMV file, but I have difficulty to add language list object (7C4346A9-EFE0-4BFC-B229-393EDE415C85) into the asf file. I am using WMSinkWriter to create a file, and how I pass input video/audio data is as following article mentions: https://docs.microsoft.com/en-us/windows/desktop/medfound/tutorial--using-the-sink-writer-to-encode-video Here's summary of what I'm doing: Call

How to read from - “unsigned char const *” when use Media Foundation?

寵の児 提交于 2021-01-29 08:42:56
问题 I have such an implementation void coAudioPlayerSampleGrabber::test(SoundDataType dataType, unsigned char const * pData, int64_t dataLen) { HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); IMFSourceReader *pReader = NULL; IMFByteStream * spByteStream = NULL; HRESULT hr = S_OK; // Initialize the COM library. hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); // Initialize the Media Foundation platform. if (SUCCEEDED(hr)) { hr = MFStartup(MF

ReadSample never returns

只谈情不闲聊 提交于 2021-01-27 20:06:48
问题 I am trying to capture camera stream with Media Foundation. My code works with the same device on Windows 10 but fails on windows 7. For some reason IMFSourceReader.ReadSample blocks and never returns. The reading is done is synchronous mode. The first call to read sample returns with pdwStreamFlags set to MF_SOURCE_READERF_STREAMTICK and no errors. Subsequent calls blocks and never returns. I am using MF_SOURCE_READER_FIRST_VIDEO_STREAM stream index to capture the images from camera. Any

The byte stream type of the given URL is unsupported MediaFoundation

喜欢而已 提交于 2021-01-07 07:01:52
问题 I need to create a reader from buffer(that is wav bytes ) in order to do it I am using such approach: void co_AudioEncoderMF::load_from_memory(unsigned char const * data, long data_size) { unsigned char * buf = new unsigned char[data_size]; //JUST FOR TEST IN ORDER TO BE SURE THAT I HAVE THIS DATA memcpy(buf, data, data_size); IMFMediaType *input_type = nullptr; IMFSourceReader *source_reader = nullptr; IMFMediaType *ouput_media_type = nullptr; IMFSinkWriter *sink_writer = nullptr; IStream *

The byte stream type of the given URL is unsupported MediaFoundation

依然范特西╮ 提交于 2021-01-07 07:00:50
问题 I need to create a reader from buffer(that is wav bytes ) in order to do it I am using such approach: void co_AudioEncoderMF::load_from_memory(unsigned char const * data, long data_size) { unsigned char * buf = new unsigned char[data_size]; //JUST FOR TEST IN ORDER TO BE SURE THAT I HAVE THIS DATA memcpy(buf, data, data_size); IMFMediaType *input_type = nullptr; IMFSourceReader *source_reader = nullptr; IMFMediaType *ouput_media_type = nullptr; IMFSinkWriter *sink_writer = nullptr; IStream *

The byte stream type of the given URL is unsupported MediaFoundation

淺唱寂寞╮ 提交于 2021-01-07 06:59:38
问题 I need to create a reader from buffer(that is wav bytes ) in order to do it I am using such approach: void co_AudioEncoderMF::load_from_memory(unsigned char const * data, long data_size) { unsigned char * buf = new unsigned char[data_size]; //JUST FOR TEST IN ORDER TO BE SURE THAT I HAVE THIS DATA memcpy(buf, data, data_size); IMFMediaType *input_type = nullptr; IMFSourceReader *source_reader = nullptr; IMFMediaType *ouput_media_type = nullptr; IMFSinkWriter *sink_writer = nullptr; IStream *

How to make implementation of IStream correctly (MediaFoundation)?

。_饼干妹妹 提交于 2021-01-07 02:34:47
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. Aleksey Timoshchenko is looking for an answer from a reputable source . General idea is to get a IMFSinkWriter that will write a data to the buffer. There is such an implementation bool co_AudioEncoderMF::start_encoding_to() { bool result = false; co_Stream stream; IMFByteStream * byte_stream = nullptr; IMFMediaSink * media_sink = nullptr; IMFSinkWriter * sink_writer = nullptr; HRESULT hr =

How to make implementation of IStream correctly (MediaFoundation)?

你。 提交于 2021-01-07 02:34:25
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. Aleksey Timoshchenko is looking for an answer from a reputable source . General idea is to get a IMFSinkWriter that will write a data to the buffer. There is such an implementation bool co_AudioEncoderMF::start_encoding_to() { bool result = false; co_Stream stream; IMFByteStream * byte_stream = nullptr; IMFMediaSink * media_sink = nullptr; IMFSinkWriter * sink_writer = nullptr; HRESULT hr =