Reputation: 7754
I am trying to figure out what APIs to use to connect and record from a webcam. In al of my research, Google, I have found many OLD articles which discus Directshow and COM. I don't want to write code that is using an obsolete API.
Any direction with this is greatly appreciated.
Upvotes: 3
Views: 674
Reputation: 1498
avicap32.dll I guess is the safest option due to its readily availability... http://channel9.msdn.com/forums/TechOff/93476-Programatically-Using-A-Webcam-In-C has the PInvoke code you will be needing.
http://codeplex.com/touchless is an interesting related project!
Upvotes: 1
Reputation: 653
If you are using Vista, you can use the new Media Foundation APIs. But, they are not available on XP, so DirectShow is the way to go. The DirectShow.NET wrapper pointed to by Shay works great with C#. Be sure to also download the Samples, there are several capture samples worth checking out like PlayCap and CapWMV.
UberDemo wrote an article about another way of capturing using the Windows Media Encoder SDK with WPF in this article.
Upvotes: 1
Reputation: 31928
DiectShow is still the best way to connect to Webcams (or other sources).
You can use DirectShow.NET which is a thin warpper arund DirectShow.
Upvotes: 1