GNOME Bugzilla – Bug 563504
add libv4l2 support to v4l2 gst plugin - required for most new webcams
Last modified: 2009-01-23 08:40:55 UTC
In kernel 2.6.27 and higher, the drivers for gspca and most uvc webcams (i.e. most USB webcams in existence) require userspace v4l2 clients to do their own video format conversion. The gstreamer v4l2 plugin (all versions up to 0.10.11, and the CVS version too, as far as I can tell) currently does not perform this conversion, hence making the plugin very nearly useless. Fortunately, Fedora has done the hard work of developing a patch for the v4l2 plugin to use the libv4l2 library to do automatic format conversion. See http://cvs.fedoraproject.org/viewvc/rpms/gstreamer-plugins-good/devel/gst-plugins-good-0.10.9-libv4l.patch?view=log Works so well that Debian and Ubuntu have borrowed and started using it too: http://packages.debian.org/changelogs/pool/main/g/gst-plugins-good0.10/gst-plugins-good0.10_0.10.11-2/changelog http://changelogs.ubuntu.com/changelogs/pool/main/g/gst-plugins-good0.10/gst-plugins-good0.10_0.10.10.4-1ubuntu1/changelog But for reasons unknown, neither Fedora nor Debian nor Ubuntu have bothered to actually submit the patch upstream! So, I suppose it falls to me, a Gentoo user, to do it for them...
Created attachment 124075 [details] [review] Fedora's v4l2 plugin libv4l2 patch, for version 0.10.11 Fedora's patch
Created attachment 124077 [details] [review] Patch to make libv4l dependency non-automagic Unfortunately, Fedora's patch makes the dependency on libv4l2 "automagic": if it's detected by configure, it will always be compiled-in, with no way to opt-out. Generally, that's not a very good policy; so here is a patch (to apply on top of Fedora's) that adds an --enable-libv4l2 flag to configure. By default, libv4l will still be compiled-in if it is found; however, now users have a way of disabling the dependency should they want to.
For tracking purposes, here is a link to the relevant bug in Gentoo bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=250079
The first part was already committed some weeks ago ;) 2008-12-07 Sebastian Dröge <sebastian.droege@collabora.co.uk> Patch by: Alexandre Rostovtsev <tetromino at gmail dot com> * configure.ac: Make usage of libv4l optional by a configure parameter. Fixes bug #563504.
Is the colorspace conversion a conversion from raw (bayer) to yuv/rgb? I am asking because we already have a colorspace conversion element that handles various yuv and rfb formats.
(In reply to comment #5) > Is the colorspace conversion a conversion from raw (bayer) to yuv/rgb? I am > asking because we already have a colorspace conversion element that handles > various yuv and rfb formats. Not that I can answer this but the only element that converts bayer is the bayer element from gst-plugins-bad (which can convert from/to rgb). ffmpegcolorspace doesn't support bayer yet.
(In reply to comment #5) > Is the colorspace conversion a conversion from raw (bayer) to yuv/rgb? I am > asking because we already have a colorspace conversion element that handles > various yuv and rfb formats. from the libv4l README: "libv4lconvert offers functions to convert from any (known) pixelformat to V4l2_PIX_FMT_BGR24 or V4l2_PIX_FMT_YUV420. Currently the following source formats are supported: jpeg, mjpeg, bayer (all 4 variants: bggr, rggb, gbrg, grbg), spca501 (chip specific yuv 420 with interlaced components), spca561 (chip specific compressed gbrg bayer) For more details on the v4lconvert_ functions see libv4lconvert.h"