Düzenle

Aracılığıyla paylaş


Instantiating an Encoder MFT

In Microsoft Media Foundation, encoders are implemented as Media Foundation transforms (MFTs). Before creating an encoder, you must first find the encoder that is most suited to your needs.

  • Windows Media audio codecs

    Category: MFT_CATEGORY_AUDIO_ENCODER

    Major type: MFMediaType_Audio

    SubType: MFAudioFormat_WMAudioV9, MFAudioFormat_WMAudioV8, MFAudioFormat_WMAudio_Lossless, MFAudioFormat_WMASPDIF

  • Windows Media video codecs

    Category: MFT_CATEGORY_VIDEO_ENCODER

    Major type: MFMediaType_Video

    SubType: MFVideoFormat_WVC1, MFVideoFormat_WMV3, MFVideoFormat_WMV2, MFVideoFormat_WMV1

Media Foundation provides several functions that your application can call to enumerate the various encoders available in your system. Encoders are registered as COM objects and the registry entry follows the standard format for COM class factories. The registry maintains the CLSIDs for the encoders, which are categorized by the media format (audio or video). The class identifiers of the Windows Media encoders are defined as constants in the wmcodecdsp.h header file. In Media Foundation, the encoders can be registered through calls to MFTRegisterLocal or MFTRegisterLocalByCLSID by specifying the category, the supported input types, and the supported output types. Upon successful registration through these functions, the MFTs are considered by the Media Foundation enumeration functions.

For creating an instance of an encoder MFT, an application has the following choices.

If your application is using Pipeline Layer ASF Components to encode a file to ASF format, you must insert the encoder MFT into the pipeline as a transform node. While creating the transform node in the encoding topology, you can either set the object type as a pointer to the IMFTransform interface or the IMFActivate object. Media Foundation provides activation objects for Windows Media encoders so that they can be conveniently set as the transform node in the encoding topology. When the topology is resolved, the Media Session uses the activation object to create an instance of the encoder MFT.

Windows Media Encoders