Retrieving the COM class factory for component wit

2019-07-31 09:18发布

I am using DirectShowLib and SampleGrabber to capture video frames of an AVI file. I am accomplishing this by using graph builder and couple of filters. Everything was working fine, I was able to initialize graph and filters.

I then added code to get some video information like Dimension, Frame rate e.t.c. For this I used to IMediaDet. But when I try to initialize it:

Type t = Type.GetTypeFromCLSID(new Guid("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA"));
IMediaDet mediaDet = (IMediaDet)Activator.CreateInstance(t);

The Activator.CreateInstance(t) throw an exception:

Retrieving the COM class factory for component with CLSID {65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA} failed due to the following error: 80040154.

I don't think its the problem with the build as the filters and graph builder are initializing fine. Any one has any idea, or is there any other API I can use to gather AVI file information like Dimensions, Frame rate, Video Length?

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-07-31 10:05

0x80040154 - is Class Not Registered - usually that means one of two things - the CLSID is wrong, or the DLL/EXE that implements that class is not (properly) registered on the machine.

You can check the registry under HKCR/CLSID to see if that is actually registered on the machine.

查看更多
走好不送
3楼-- · 2019-07-31 10:14

I think you mistyped the Guid. It is close to one supported by qedit.dll, 65BD0711-24D2-4FF7-9324-ED2E5D3ABAFA, you're off by one digit.

查看更多
登录 后发表回答