Problem connect to directshow camera

Post Reply
y3000
Posts: 3
Joined: Fri Mar 15, 2024 12:56 am

Problem connect to directshow camera

#1

Post by y3000 »

I have a Hikrobots MV-CE200-11UM industrial camera with directshow driver. When I try to connect it on SharpCap, it always pop up an error message, error starting camera, if I click OK button and try to connect again, then pop up the camera access denied. I can confirm I have turn 'ON' access to camera on my Windows 11 privacy setting . I can use amcap or graphedt to connect to camera and show the living images.

I have try directshow driver of 32 and 64 bit, with SharpCap of 32 and 64 bit , it still the same so, the attachment file is the 32 bit log of SharpCap, Could you have a look what is happen ?
屏幕截图 2024-04-20 105754.png
屏幕截图 2024-04-20 105754.png (153.42 KiB) Viewed 172 times
屏幕截图 2024-04-20 104014.png
屏幕截图 2024-04-20 104014.png (64.2 KiB) Viewed 172 times
屏幕截图 2024-04-20 104053.png
屏幕截图 2024-04-20 104053.png (71.09 KiB) Viewed 172 times
屏幕截图 2024-04-20 104251.png
屏幕截图 2024-04-20 104251.png (48.35 KiB) Viewed 172 times
屏幕截图 2024-04-20 104736.png
屏幕截图 2024-04-20 104736.png (182.96 KiB) Viewed 172 times
Attachments
Log_2024-04-20T10_36_37-14140.log
(36.92 KiB) Downloaded 18 times
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Problem connect to directshow camera

#2

Post by admin »

Hi,

the log indicates that the failure is happening when SharpCap has requested the IAMCameraControl interface from the directshow driver. It looks like the IAMCameraControl interface is found, but there is a failure trying to wrap the result as a managed object so that the C# code in SharpCap can talk to it. This failure is occurring inside code from the .NET core libraries, so it's difficult to track down the exact causes.

Code: Select all

Error  	10:39:43.480498	#1 	Failed to initialize camera controls. : Exception of type 'ArgumentException' : 参数错误。 (0x80070057 (E_INVALIDARG)) 
Stack Trace:   at object System.StubHelpers.InterfaceMarshaler.ConvertToManaged(ref IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags)
Do other directshow cameras work correctly for you? That would imply that there is something odd about the drivers for that particular camera that are causing the problem.

I did have a look at the source code for the point in the .NET core libraries where the failure happens (https://github.com/dotnet/runtime/blob/ ... .cpp#L4062) , but it is not obvious from the code what could cause the 'E_INVALIDARG' error at that point.

At a guess, I'd say that something subtle isn't quite right with either the way that the Directshow driver implements the necessary COM objects and interfaces, or something not quite right with the registration of the COM objects in the DirectShow driver DLL is causing this issue. This is more instinct than deduction though.

sorry not to be able to give any more help,

Robin
y3000
Posts: 3
Joined: Fri Mar 15, 2024 12:56 am

Re: Problem connect to directshow camera

#3

Post by y3000 »

I have another camera come from IRayple(https://www.irayple.com/cn/productDetail/140), it's directshow driver work with SharpCap.
Post Reply