In the folder is Intel Media SDK sample code about Media Foundation plugins (Intel MFT).
C:\\Program Files\\Intel\\Media SDK\\220.127.116.1171\\samples\\sample_plugins\\mfoundation\\
I implemented a program for do H.264 encoding based on Microsoft Media Foundation (using sinkwriter method, not media session).
and I call regsvr32.exe in the command line to forcelly register mfx_mft_h264ve_32.dll in the system (windows7 + Intel SandyBridge x64).
and then I run the program. The CPU utilization is really very low. It is about 15 ~ 25%.
It seems that the HW encoding function is really enabled.
However, when I use Intel Media Checker, the report said that the Intel Media SDK SW and HW encoding functions are both not called. (SW and HW both ZERO times)
In conclusion, the program does not really run Intel MFT.
I asked Mircosoft engineers. They told me I could register Intel MFT locally before Media Foundation sinkwriter will select Intel MFT to execuate.
I register MFT locally just like this:
InputTypes.guidMajorType = MFMediaType_Video;
InputTypes.guidSubtype = MFVideoFormat_NV12 ;
OutputTypes.guidMajorType = MFMediaType_Video;
OutputTypes.guidSubtype = MFVideoFormat_H264;
hr_SW = MFTRegisterLocalByCLSID( CLSID_MF_H264EncFilter, MFT_CATEGORY_VIDEO_EFFECT, L"Intel\\xae Media SDK H.264 Encoder MFT", MFT_ENUM_FLAG_ALL, 1, &InputTypes, 1, &OutputTypes);
However, when I try to enumerate MFTs, this Intel MFT always can not appear locally.
hr_SW = MFTEnumEx( MFT_CATEGORY_VIDEO_ENCODER, MFT_ENUM_FLAG_LOCALMFT , &InputTypes, &OutputTypes, &ppMFTActivate, &cMFTActivate );
hr_SW = ppMFTActivate->GetGUID( MFT_TRANSFORM_CLSID_Attribute, &m_clsid );//get CLSID from this enumerated MFT
m_clsid is 6CA50344-051A-4DES-9779-A43305165E35, but CLSID_MF_H264EncFilter shoud not be this number.
I look up the registry, 6CA50344-051A-4DES-9779-A43305165E35 should mean Micorsoft H.264 Encoder MFT.
and if I call like this : hr_SW = MFTEnumEx( MFT_CATEGORY_VIDEO_ENCODER, MFT_ENUM_FLAG_ASYNCMFT | MFT_ENUM_FLAG_LOCALMFT, &InputTypes, &OutputTypes, &ppMFTActivate, &cMFTActivate );
then CLSID_MF_H264EncFilter would be enumerated.
Do you know why this case happen? It seems that CLSID_MF_H264EncFilter is already registered in the system, but can not be registered locally. In this case, I do not know how to make sinkwriter choose CLSID_MF_H264EncFilter to do encoding, not default Microsoft H.264 Encoder MFT.