Is there any simple C++ code to grab video from UVC webcam and display it simultaneously?

Posted by mShero on Ask Ubuntu See other posts from Ask Ubuntu or by mShero
Published on 2012-06-21T02:36:39Z Indexed on 2012/06/21 3:25 UTC
Read the original article Hit count: 164

Filed under:
|
|

I'm very very new to Linux and programming!

I'm using ubuntu 11.10 - 64 bits with gcc 4.6.1

I've been searching online for an example C++ code that simply grabs video from a compliant UVC webcam and displays it simultaneously.. I need to compile it on gcc.

In OpenCV, it's a very simple code less than 20 lines as I remember!

I found this: http://v4l2spec.bytesex.org/spec/capture-example.html

But it's very huge code relative to OpenCV code ?! and even when I tried to compile it using gcc.. I got many errors!

I copied the code into a cpp file: cap.cpp

then wrote in the terminal: gcc cap.cpp -o cap

and the errors showed up... same errors with g++

I hope if someone can help me and tell me where can I find another simpler code? and how can I test it ?

Thank you :)

© Ask Ubuntu or respective owner

Related posts about webcam

Related posts about gcc