diff --git a/plugins/win-mf/mf-h264.cpp b/plugins/win-mf/mf-h264.cpp index e26f37c2fe0dfa0b718eee65e9174d0058d2753c..9a17b0469093f7ad0ef79133214479d4cb1b4524 100644 --- a/plugins/win-mf/mf-h264.cpp +++ b/plugins/win-mf/mf-h264.cpp @@ -504,6 +504,16 @@ static bool MFH264_Update(void *data, obs_data_t *settings) return true; } +static bool CanSpawnEncoder(std::shared_ptr descriptor) +{ + HRESULT hr; + ComPtr transform; + + hr = CoCreateInstance(descriptor->Guid(), nullptr, + CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&transform)); + return hr == S_OK; +} + void RegisterMFH264Encoders() { obs_encoder_info info = { 0 }; @@ -527,6 +537,11 @@ void RegisterMFH264Encoders() if (e->Type() == EncoderType::H264_SOFTWARE) continue; + /* certain encoders such as quicksync will be "available" but + * not usable with certain processors */ + if (!CanSpawnEncoder(e)) + continue; + info.id = e->Id(); info.type_data = new TypeData(e); info.free_type_data = [] (void *type_data) {