Click here to Skip to main content
15,881,248 members
Articles / Programming Languages / C#
Technical Blog

Controlling Your Web Camera Using C#

Rate me:
Please Sign up or sign in to vote.
4.92/5 (7 votes)
3 May 2013GPL31 min read 86.1K   19   3
Controlling your web camera using C#.

I have recently been looking for a C# project to control my web cam or an attached video camera.  Apparently, this is a tall order since most video camera controllers are written in very low level C or C++ and not easily wrapped in C# without using P/Invoke and many Dllimport statements (i.e. un-managed and possibly unsafe code).

I did stumble across the Versatile C# Webcam Library on Code Project.  However, after downloading the project’s source code, it took me quite a while to get it to compile in Visual Studio 2010.  Apparently, one of the C++ libraries used (qedit.h)  is no longer included with Windows 7.  After reading countless comments, adding a custom header file for qedit.h, and tinkering, I was able to get this project to compile in Visual Studio 2010.

For anyone who is interested, you can find the working code below!

Edit

A copy of the source code compiled in release mode can be found here HERE (version 2).

A “Published” version of the code can be found HERE.

Additional Resources:

Here is a link to the DirectShow.Net project on Sourceforge.  If you still have found what you are looking for, I believe this DirectShow.dll contains the most comprehensive set of features for controlling video.  I have not really tested this .NET wrapper, but it looks like it covers just about everything in DirectShow, and it comes with tons of example projects!

Here is a link to a very simple .NET wrapper for Microsoft’s latest video controller WIA.

Here are a few Video links from StackOverflow as well:

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Student
United States United States
If you would like to know more about me, please feel free to visit my website at http://www.jakemdrew.com/

Thanks!

Jake Drew

Comments and Discussions

 
SuggestionWebcam managing solution Pin
David T. Kerrigan1-Oct-14 23:56
David T. Kerrigan1-Oct-14 23:56 
Questionwebcam campture Pin
rakdosss2-Apr-14 5:49
rakdosss2-Apr-14 5:49 
AnswerRe: webcam campture Pin
Jake Drew2-Apr-14 6:10
Jake Drew2-Apr-14 6:10 
You are very welcome!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.