Antoni
Antoni

Reputation: 2179

Webcam video program in C for Windows

I would like to code an app that captures a video from a webcam connected to the PC. I have found tutorials in other webs but they were in C++ or C# and I'm interested in doing it using C.

Do you know some web or have some knowledge that could help me with it?

I imagine that I would have to start my code "asking permission" to the SO to allow me to connect to the webcam but.... I have no idea how to do it neither how to continue.

Upvotes: 2

Views: 3882

Answers (2)

lulyon
lulyon

Reputation: 7225

I've noted your tag that you are on Windows, so this c library video4linux would not work for you.

However, in many cases OpenCV(in C/C++) will do it just fine. A lot parts of OpenCV are pure C, in which "Video Analysis" part might suits part of your need. Find this: http://opencv.willowgarage.com/documentation/c/

If you have to call the C++ part of OpenCV, you can write a c wrapper for the C++ part, while your remaining code could stay pure C. Reference this: Developing C wrapper API for Object-Oriented C++ code

Upvotes: 1

jocke-l
jocke-l

Reputation: 703

Capturing video input is very system dependent, as different systems handles it in different ways. You can use a library that is doing the hard work for you (either system independently or not) or you could write your own library to do what you want.

If you want a system independent solution you can take a look at OpenCV

Upvotes: 1

Related Questions