locked
custom MFT in Sink Writer RRS feed

  • Question

  • Hi, everyone:

     

    I already build up a software system to do H.264 encoding based on sink writer.

     

    However, I want to change MFT (encoder) inside to be the other MFT( a dll file), which is provided by Intel Media SDK.

     

    How can I do that?

    Thursday, December 30, 2010 11:32 AM

All replies

  • If the MFT provided by the Intel Media SDK is registered as a hardware encoder, then it you can use the MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS attribute to enable hardware transforms for the sink writer. 

    If it is not registered or is not a hardware encoder, you can override the encoder choices for your application by using MFTRegisterLocal/MFTRegisterLocalByCLSID.  This will not apply to other applications on the system, but it will ensure that the encoder of your choice is used whenever possible in your application.

    Friday, December 31, 2010 2:34 AM
  • If the MFT provided by the Intel Media SDK is registered as a hardware encoder, then it you can use the MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS attribute to enable hardware transforms for the sink writer. 

    If it is not registered or is not a hardware encoder, you can override the encoder choices for your application by using MFTRegisterLocal/MFTRegisterLocalByCLSID.  This will not apply to other applications on the system, but it will ensure that the encoder of your choice is used whenever possible in your application.


    Hey, guys. I use regedit to find out there exist registered MFTs provided by Intel Media SDK as HW encoder.

    However, whatever I set MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS TRUE or FALSE, the CPU utilization is not different.

     

    Please give me a hand, thanks.

    Friday, January 14, 2011 9:25 AM
  • A hardware MFT must provide a certificate to verify its registration, or it will not be enumerated.  You can check for hardware MFTs on a system by calling MFTEnumEx with the MFT_ENUM_FLAG_HARDWARE flag and NULL as the input and output types.  If there is something in the output list, then there is a hardware MFT on the system.  Otherwise, there is something wrong with the registration.

    As I mentioned, you can always override the default preferences and certificate validation by registering local MFTs for your application.

    Thursday, January 20, 2011 1:26 AM
  • A hardware MFT must provide a certificate to verify its registration, or it will not be enumerated.  You can check for hardware MFTs on a system by calling MFTEnumEx with the MFT_ENUM_FLAG_HARDWARE flag and NULL as the input and output types.  If there is something in the output list, then there is a hardware MFT on the system.  Otherwise, there is something wrong with the registration.

    As I mentioned, you can always override the default preferences and certificate validation by registering local MFTs for your application.


    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.

    Friday, January 28, 2011 10:53 AM