PDA

View Full Version : wrapper+v4l2



ehernandezd
28th March 2008, 00:27
Hello guys, how are you??
is there any wrapper for v4l2???

pherthyl
29th March 2008, 22:13
If you find one I would love to hear about it. I too have been looking for the best way to access V4L devices on linux but haven't really found a good way that doesn't involve raw V4L programming.

Either you could use gstreamer, which is at least somewhat higher level, but right now I'm leaning towards using the code of a little webcam capture app called webKam. http://kde-apps.org/content/show.php/webKam?content=76902

It uses kopete's video capture code, so it should be reasonably well tested, and the code is very simple right now.

firas
4th April 2008, 17:20
greetings guys,
I've been using v4l2 for sometime and find it rather not very hard and no need for wrapper (which it will most likely lead to under-performance ?)
I am attaching example code for using V4L2 for web cameras (this QT3.x but very portable).
I'll also look for some previous work that deploys V4L2 for tv cards (Philips SAA713x Chipset).
If you have specific issue post them, maybe I can help.
cheers

pherthyl
4th April 2008, 23:16
Awesome. I will take a look at this.

On second look, your code seems to be specific to PWC webcams. At first glance it seems that won't work for any other webcams. It shouldn't be necessary to access and pwc headers directly.

On third look, I dunno why you included libpwc.h/cpp, but they seem to not relate to the rest of the code.. I'll have a look at the rest.

Hmm.. Well not sure if its worth the effort. Got that code stripped down to the basics, but so far I fail at compiling the ccvt lib (after finally tracking it down). Have you tested your code with other cameras or is it Logitech specific?

firas
5th April 2008, 17:48
On second look, your code seems to be specific to PWC webcams. At first glance it seems that won't work for any other webcams. It shouldn't be necessary to access and pwc headers directly.
On third look, I dunno why you included libpwc.h/cpp, but they seem to not relate to the rest of the code.. I'll have a look at the rest.

Well the PWC headers are related to the driver, and yes they might be not necessary. I must have added them while trying to figure out things.



Hmm.. Well not sure if its worth the effort. Got that code stripped down to the basics, but so far I fail at compiling the ccvt lib (after finally tracking it down). Have you tested your code with other cameras or is it Logitech specific?

Yes/No the cameras I tested this code with were logitch, but the code is general I believe .
I started first exploring the capabilities of V4L2 using a console based simple program (attached). Then from there and with the help of the V4L2 API documentation + experience I figured out the rest. I hope the attached console example be useful.
cheers