C # + DirectShow.NET = easy access to webcam?

I found an example for accessing a webcam in C #. This example uses the DirectShow.NET library. I tried to understand the code, but so far the only thing I could understand was that the user control calls directshow to draw directly on the surface of the user control.

I want to access each frame and put it in a Bitmap object. How can I find out when a new frame appeared? How can I capture this new frame into a Bitmap object?

This might just be the answer if you know your way in DirectShow.NET.

+6
c # webcam directshow
source share
3 answers

You will need to use the ISampleGrabber interface, there are many C ++ examples on the network about how to use it, this will give you data in RGB format, which you can use in the Bitmap class.

There is also an open source Touchless library , it has a project in code that takes a webcam and gives you a callback every time a new frame arrives.

+5
source share

Be sure to check out this article - http://www.codeproject.com/Articles/125478/Versatile-WebCam-C-library ; it is based on the Touchless WebCam capture component (but without other parts from the Touchless SDK).

+4
source share

If you found Touchless useful but would like to use the latest DirectX SDK, try getting the latest source after changing 31008 to http://touchless.codeplex.com/SourceControl/ListDownloadableCommits.aspx

0
source share

All Articles