1

I am trying to find available DirectShow video encoders, using following code:

ICreateDevEnumPtr pEnm(CLSID_SystemDeviceEnum,NULL,CLSCTX_INPROC_SERVER);
// Video Compressor
if(pEnm!= NULL)
{
    IEnumMonikerPtr pEnumMoniker;
    hr = pEnm->CreateClassEnumerator(CLSID_VideoCompressorCategory,&pEnumMoniker,0);
    //......
}

However, some video compressors installed in the system (Windows 10 x64) have different category. For example "Microsoft MPEG-2 Encoder" and "VisioForge H264 Encoder" have category {083863F1-70DE-11d0-BD40-00A0C911CE86} - CLSID_LegacyAmFilterCategory

If I use CLSID_LegacyAmFilterCategory instead of CLSID_VideoCompressorCategory in my code, I get a lot of irrelevant objects.

Can you suggest the proper way to enumerate the DirectShow video compressors installed in the system ?

Kola73
  • 134
  • 1
  • 7

1 Answers1

0

There is no better way and most likely you don't need any other way. You need this enumeration to eventually check availability of specific codec of interest and instantiate it. It is hard to imagine that you are building an application capable to pick some arbitrary installed codec and be able to use it, you normally deal with compression codecs you are well familiar with, esp. H.264 video compression codecs which have certain specific configuration methods etc. For the codecs you are familiar with you would want to have codec specific instantiation and configuration ways, one might need a discovery through enumeration, another would be available for instantiation via CLSID directly.

Roman R.
  • 68,205
  • 6
  • 94
  • 158