Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webcam access in c++ without openCV

Tags:

c++

Can I make some c++ webcam program without using opencv (and without others external library)? My idea is to take the data from the webcam and display it on window, like a live video. Could you show me some example? Sorry for my bad english. Thank you very much.

like image 671
user1491548 Avatar asked Oct 07 '22 14:10

user1491548


1 Answers

Long story short: for windows and C/C++ the most straightforward way is by using the DirectShow.

There is a nice wrapper of DirectShow framegrabber here: http://www.muonics.net/school/spring05/videoInput/

Yes, you still need the DXSDK installed, but actually I managed to extract the required DShow interfaces into the single 100kb file. So my advice: live with the videoInput library.

On linux the Video4Linux(2) library is somewhat simpler. Everything is done through file-like APIs.

On MacOS X you have the QTKit. To make a simple window with live camera stream is a breeze. The sample is right in the Apple's documentation.

like image 91
Viktor Latypov Avatar answered Oct 10 '22 02:10

Viktor Latypov