- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the folder is Intel Media SDK sample code about Media Foundation plugins (Intel MFT).
C:\\Program Files\\Intel\\Media SDK\\2.0.12.24071\\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 );
CLSID m_clsid;
hr_SW = ppMFTActivate[0]->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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are the problems I've run into trying to use the Intel Media SDK H264 Encoder using Media Foundation:
1) The encoder requires a NV12 input: "The Intel Media SDK sample filters require the input data to be in NV12 format. NV12 is the native format of the GPU, and thus the filters need this format to pass the data to the hardware for acceleration. Developers may find the need to insert a color conversion filter upstream of the sample decoder filter in order to connect the graph successfully."
2) There is no readily available transform to do this color converstion. The color converter transform from Microsoft does not support NV12 (http://msdn.microsoft.com/en-us/library/ff819078(v=VS.85).aspx) and "The Intel Media SDK does not provide a sample color conversion filter at this time. This is left to the developer to implement"
3) I was not even able to test the Intel encoder by reading in a NV12 formatted file because MFCreateSourceReaderFromURL is returning 0xC00D36C4 (Unsupported Bytestream) on any NV12 files I create.
4) so in order to use the Intel Media SDK H264 Encoder with Media Foundation, I will have to write a transform to output to NV12.
The Intel VPP can do the color conversion I would need in the transform (see sample_vpp from the Intel Media SDK), but it may make more sense to just use the API provided in the Intel Media SDK to do the entire video pipeline. The samples have the necessarily pieces (sample_encode can use NV12(or YUV420) to encode with H264 and sampe_vpp can convert from YV12, YUY2, RGB3, and RGB4 to NV12) - and the sample_multi_transcode does the whole pipeline.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
I tried your suggestion, but the result is the same.
When enumeration locally (by MFT_ENUM_FLAG_LOCALMFT) , I only get Microsoft H.264 Encoder MFT, not Intel MFT.
However, when enumeration by MFT_ENUM_FLAG_ASYNCMFT, I can get Intel MFT not locally.
When enumeration by MFT_ENUM_FLAG_LOCALMFT |
MFT_ENUM_FLAG_ASYNCMFT, I only can get Intel MFT.
Could you give me more direction?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Attached please see the report, which is just Intel Media Checker created.
My issue is really easy.
I call MFTRegisterLocalByCLSID to register Intel MFT.
Sinkwriter of Microsoft Media Foundation should choose this local MFT as encoder.
Then, I can use Intel MFT to do HW encoding on SandyBridge. --> my goal
However, Intel Media Checker report nothing about Intel Media SDK call.
It is really not normal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to use Microsoft tool MFTRACE.exe, and I found something interesting:
The log, made by MFTRACE.exe, in the beginning, would show
CoCreateInstance @ New MFT @00ABAB48, MF_TRANSFORM_ASYNC=1;MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE=1
and I tried every stream media input types for H.264 encoder listed in MSDN (http://207.46.16.248/en-us/library/dd797816(VS.85).aspx):
- MFVideoFormat_I420
- MFVideoFormat_IYUV
- MFVideoFormat_NV12
- MFVideoFormat_YUY2
- MFVideoFormat_YV12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://social.msdn.microsoft.com/Forums/en/mediafoundationdevelopment/thread/137b2208-8601-4633-88f9-30cc79cb7794
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are the problems I've run into trying to use the Intel Media SDK H264 Encoder using Media Foundation:
1) The encoder requires a NV12 input: "The Intel Media SDK sample filters require the input data to be in NV12 format. NV12 is the native format of the GPU, and thus the filters need this format to pass the data to the hardware for acceleration. Developers may find the need to insert a color conversion filter upstream of the sample decoder filter in order to connect the graph successfully."
2) There is no readily available transform to do this color converstion. The color converter transform from Microsoft does not support NV12 (http://msdn.microsoft.com/en-us/library/ff819078(v=VS.85).aspx) and "The Intel Media SDK does not provide a sample color conversion filter at this time. This is left to the developer to implement"
3) I was not even able to test the Intel encoder by reading in a NV12 formatted file because MFCreateSourceReaderFromURL is returning 0xC00D36C4 (Unsupported Bytestream) on any NV12 files I create.
4) so in order to use the Intel Media SDK H264 Encoder with Media Foundation, I will have to write a transform to output to NV12.
The Intel VPP can do the color conversion I would need in the transform (see sample_vpp from the Intel Media SDK), but it may make more sense to just use the API provided in the Intel Media SDK to do the entire video pipeline. The samples have the necessarily pieces (sample_encode can use NV12(or YUV420) to encode with H264 and sampe_vpp can convert from YV12, YUY2, RGB3, and RGB4 to NV12) - and the sample_multi_transcode does the whole pipeline.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page