ms-media-foundation

How to use hardware H.264 encoder in Windows Media Foundation

我的未来我决定 提交于 2019-12-12 22:01:34
问题 I'm writing a program using H.264 encoder MFT to do video encoding. The way I'm using to select/create the encoder is like: MFT_REGISTER_TYPE_INFO encoderInfo; encoderInfo.guidMajorType = MFMediaType_Video; encoderInfo.guidSubtype = MFVideoFormat_H264; // H.264 Encoder class id is not exposed, so we have to enumerate HRESULT hr = MFTEnum(MFT_CATEGORY_VIDEO_ENCODER, 0, NULL, &encoderInfo, NULL, &pCLSIDs, &nCount); if (nCount == 0) { break; } //Create H.264 Encoder MFT instance ciEncoder

How to use Windows Media Foundation with UWP without a topology

天大地大妈咪最大 提交于 2019-12-12 18:16:26
问题 I have been reading the Polinger book "Developing Microsoft Media Foundation Applications" in order to understand the Microsoft sample MixedRemoteViewCompositor for the Hololens. A key concept of the text is that Media Foundation components are COM objects that are connected into a graph structure called a Topology. However, the sample code is for Universal Windows Platform (UWP) and the word "topology" does not exist anywhere in the code. The call to create a topology does not exist in the

how encode bitmap with H264 video encoder MFT in windows

﹥>﹥吖頭↗ 提交于 2019-12-12 17:10:39
问题 My application do encoding of captured frame from GDI or DXGI method. currently i am doing encoding with help x264 library. AFAIK x264 is software based library, i want to do encoding with help of GPU, so it can save CPU cycles and hope speed also will be faster. After searching, I found a H.264 Video Encoder MFT which is doing h264 encoding. But couple of questions are answered for me. 1) is It faster than x264 encoding library? 2) can bitmap frame be encoded with help this MFT? - i have

Media Foundation onReadSample wrong size of returned sample

夙愿已清 提交于 2019-12-12 15:08:43
问题 I am working on translating a capture library from DirectShow to MediaFoundation. The capture library seemed to work quite well but I face a problem with an integrated webcam on a tablet running Windows 8 32 bit. When enumerating the capture format (as explained in Media Foundation documentation), I got the following supported format for the camera: 0 : MFVideoFormat_NV12, resolution : 448x252, framerate : 30000x1001 1 : MFVideoFormat_YUY2, resolution : 448x252, framerate : 30000x1001 2 :

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

感情迁移 提交于 2019-12-12 09:01:40
问题 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

Video resizing with the Video Processor MFT

核能气质少年 提交于 2019-12-12 06:19:21
问题 I'm using the video processor MFT for pixel format conversion. That works fine. But when I change the input size and keep the output the same the processing of the input hr = ColorConv->ProcessInput(0, pSample, 0); fails with: The data specified for the media type is invalid, inconsistent, or not supported by this object. I think I need to make some settings for the video resizer but I can't figure out the minimal conditioins. What I read is that I need to set SetFullCropRegion but that does

Debug Media Foundation

ぐ巨炮叔叔 提交于 2019-12-12 06:04:27
问题 I'm currently trying to write a ByteStreamHandler and an audio decoder to add support for an unsupported codec in a windows store app. I followed this MPEG1 sample and adjusted it for my needs. However I'm not sure if it is loaded correctly since I always get the error MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED with the HRESULT E_FAIL . I've added values to all E_FAIL results I use in my code to figure out where it happens unfortunately it doesnt seem to happen in my code. Now I'd like to know if

Media Foundation set video capture frame rate using PROPVARIANT structure

旧街凉风 提交于 2019-12-12 05:49:04
问题 I'm writing a media foundation application where I need to set the capture frame rate for a video device. The function I'm writing is something like: bool SetRequestedFrameRate(const size_t requestedFramesPerSecond); where I pass a user-defined integer as the frame rate parameter. I'm following the code snippet on https://msdn.microsoft.com/en-us/library/windows/desktop/ff485859(v=vs.85).aspx : PROPVARIANT var; if (SUCCEEDED(pType->GetItem(MF_MT_FRAME_RATE_RANGE_MAX, &var))) { hr = pType-

Media Foundation h264 encoder poor performance

南笙酒味 提交于 2019-12-12 04:37:35
问题 Media Foundation h264 encoder poor performance I'm writing an application which records PC's screen in realtime and encodes it with Media Foundation h264 codec. Encoding consumes a lot of CPU resources. And after I stop recording video (or pause it by simply stopping feeding an encoder with video and audio frames), CPU load stays very high for a long period of time (5-10 seconds and more). During this time application waits until IMFSinkWriter::Finalize method completes. My PC configuration:

Noise occurs while encoding audio from Microphone and latency in video streaming using IMFSourceReader

别说谁变了你拦得住时间么 提交于 2019-12-12 04:31:34
问题 I'm developing an application to capture.MP4 file (video(USB Camera)and audio(Any Microphone) together )during video streaming using SourceReader. My code is returning success for all API's and able to save the video. I'm facing below 3 issues. After 10secs of recording , fps goes into 0 and resume to 1fps(Note: Saving video for 1080p 60fps). FPS is not resuming to 60fps. While playing the recorded file, noise audio only playing for the whole file. Recorded audio file is not playing. To stop