secile / UsbCamera

C# source code for using usb camera and web camera in WinForms/WPF. With only single CSharp source code. No external library required.
MIT License
179 stars 55 forks source link

Capture Pin not working on all cameras #33

Open EugeneQilo opened 6 months ago

EugeneQilo commented 6 months ago

Hello @secile, We deployed the latest version, and we have this observation. The Still Pin works on some Cameras but it doesn't on some other cameras. To be accurate, it was tested on 3 cameras, only 1 worked.

Could there be anything missed in the code? We have access to one of the cameras that didn't work, so if there is anything to check to troubleshoot this issue we will be happy to do.

secile commented 6 months ago

Thank you for your information.

Could you check camera.StillImageAvailable flag? If flag is false, the camera is not support still image capture. Not all camera supports still imagecapture.

EugeneQilo commented 6 months ago

@secile that flag is false, but these are intraoral cameras used in dentistry and they have capture buttons. What else can I check for this?

secile commented 6 months ago

about line 276, does variable sample is null?

var sample = ConnectSampleGrabberAndRenderer(graph, builder, vcap_source, DirectShow.DsGuid.PIN_CATEGORY_STILL);

if sample is not null, about line 283, does variable video_con is null?

var video_con = vcap_source as DirectShow.IAMVideoControl;