On 6/8/07, Laurent Pinchart <[EMAIL PROTECTED]> wrote:
> Hi Paolo,
>
> > when I grab frames from my Logitech Fusion cam (using
> > a code based on
> > http://v4l2spec.bytesex.org/v4l2spec/capture.c) i can
> > save them in YUYV format.
> > Now i need to convert them in RGB format in order to
> > see them with common viewers. Are there helper
> > functions in v4l2 API for this?
>
> No there isn't. V4L2 is a kernel/userspace interface and doesn't provide video
> format conversion.
>
> > Otherwise, is there any other lib which I can use,
> > instead of writing from scratch a converter?
>
> There are probably YUYV to RGB converters in major codec libraries and/or in
> webcam applications.
>
> Lots of people have stated their interest for a userspace V4L2 library which
> would handle simple video format conversions. Unfortunately, nobody has
> implemented it yet. Wanna have a go ? :-)
>
> Laurent Pinchart
> _______________________________________________
> Linux-uvc-devel mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/linux-uvc-devel
>

Hi Laurent Pinchart,

In fact, I have implemented a v4l2 library for my own project. And
just published on web. You could download the source code through
Bazaar:

bzr branch http://benlau.e-fever.org/projects/bzr/libv4l2 libv4l2

Features of the library:

- V4L2 API (only)

- Query and set video device properties that include:
        Resolution , Image Format, Channel, Norm , fps,...

- Read/Write and Memory mapped streaming I/O

- YUYV/YUV420 to RGB conversion. (No MJPEG yet)

- A simple GTK+ dialog to choose the video device to open and set the
properties.

- Utility to convert video frame to IplImage format for use with OpenCV.

License: BSD

The source comes with two libraries. They are libv4l2 and libcv-v4l2.
libv4l2 is the core library to deal with v4l2 device. libcv-v4l2 is
"supposed" to be an extension to OpenCV for access low level device
setting, but only few functions are implemented and the design is not
well. It will be completely rewrote afterward. All features that
should not be provided by libv4l2 will be there(e.g GTK+ Dialog)

libv4l2 itself is a very simple library that just requires standard
library like libc6-dev in order to build, but libcv-v4l2 need packages
of  gtk+-2.0 and OpenCV.

The package of OpenCV has been available in Debian Etch/SID, they
could be installed by :

        apt-get install libcv-dev libcvaux-dev libhighgui-dev

The build instructions:

aclocal
automake
autoconf
./configure --prefix=/tmp/usr # for testing
make
make install

There are two demo applications available. The first one is a video
viewer with two dialogs to choose the input video device and set the
properties respectively. The other one is a face detection program
based on the sample code from OpenCV :

/tmp/usr/bin/v4l2-demo
/tmp/usr/bin/facedetect

The library is still under development. The API may change for new
version. Therefore, only static link libraries are provided.

API Doc:

http://benlau.e-fever.org/projects/docs/libcv-v4l2/index.html
http://benlau.e-fever.org/projects/docs/libv4l2/index.html

Known Issue: Could not use streaming I/O with EM28XX driver. The mmap
function reports error.

Please feel free to contact me for any comment for the source. :)
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to