We have a C # application that processes video streams. This is a low-level application that receives every frame in Bitmap format, so basically we need 25 images per second. This application already works for some of our media sources, but now we need to add a webcam as an input device.
Thus, we basically need to constantly capture bitmaps from a webcam so that we can transfer all these frames as a βstreamβ to our application.
What is the best and easiest way to access the webcam and view actual frames directly from the webcam as separate images? I'm still in the starting blocks.
There are many libraries that allow you to access the webcam, view the contents of the webcam in the Windows panel, and then use screen capture to capture the image again. This, unfortunately, will not give us the necessary performance when capturing 25 frames per second. IVMRWindowlessControl9 :: GetCurrentImage is referred to as another alternative, but again it seems to be aimed at an infrequent snapshot rather than a constant stream of images. Directshow.Net is mentioned by many as a good candidate, but it is unclear how easy it is to capture images from a webcam. In addition, many sources claim that Microsoft no longer supports Directshow. In addition, the implementations I saw from this require ImageGrabber, which apparently also is no longer supported . The newer alternative to MS is the Media Foundation, but in my research there are no working examples of how this can be implemented (and I'm not sure if this will work on older versions of Windows such as XP). DirectX.Capture is a terrific library ( see a nice implementation ), but it seems that there are not enough filters and methods for directly receiving video images. I also started looking at Filters and Filters , but it seems terribly complicated and a bit like reinventing the wheel.
In general, all the solutions briefly mentioned above seem rather old. Can someone point me in the direction of a walkthrough to get a webcam running in C # and capture a few images per second from it? (We will also need to make the sound at some point, so the solution that does not exclude the video will be most useful).
source share