[arch-dev-public] Request for new extra package: libv4l / Roadmap to better Webcam support

Thomas Bächler thomas at archlinux.org
Wed Oct 15 13:00:59 EDT 2008


It all starts here: http://bugs.archlinux.org/task/11736

Many webcam drivers are now available for Linux in the 2.6.27 kernel. 
The current basis is video4linux 2 (v4l2), but there are problems:

1) Many applications only support v4l1, while many v4l2 drivers have 
missing or incomplete v4l1 emulations
2) Many webcams only support weird image formats requiring conversion 
which is not done in the kernel, so they won't work in either v4l1 or 
v4l2 programs.

The solution is libv4l. See http://hansdegoede.livejournal.com/3636.html 
and http://people.atrpms.net/~hdegoede/libv4l-0.5.1.tar.gz.

libv4l provides the following features:
1) Using libv4l1, all v4l2 devices are supported by old v4l1 
applications. All that has to be done is replace open, close, mmap and 
ioctl calls to the video device by v4l1_open, v4l1_close, v4l1_mmap and 
v4l1_ioctl respectively.
2) libv4l2 provides a similar wrapper for v4l2 applications.
3) Both of these libraries use libv4lconvert to convert all known image 
formats to BGR24 or YUV420 if necessary, so that applications will be 
able to use them.
4) There are two LD_PRELOAD wrappers, v4l1compat and v4l2convert. 
v4l1compat can be preloaded to allow (binary) v4l1 applications to use 
all v4l2 devices and use the conversion feature of libv4lconvert. 
v4l2convert can be preloaded to allow (binary) v4l2 applications to use 
the conversion features as well.

I suggest the following roadmap:
1) Add libv4l 0.5.1 to extra (I can do that).
2) Provide a HOWTO on the wiki on how to use the LD_PRELOAD wrappers to 
gain support for your camera (Should be done by a user who has done 
stuff on the wiki before).
3) Adjust applications to use libv4l directly. 
http://linuxtv.org/v4lwiki/index.php/Libv4l_Progress is part of a 
cross-distro effort (although all the work so far has been done by 
Fedora apparently) to fix applications. Right now, patches for 
gstreamer, vlc and xawtv exist, ptlib already includes support for 
libv4l when it is installed at compile-time. Apply those patches and in 
the long run adjust more applications to use libv4l, then submit those 
patches upstream.


Just from my personal experience: I own a camera that is supported by 
the gspca_ov519 driver included in 2.6.27. However, this camera has only 
support for jpeg, and thus won't work in any v4l(2) application. By 
preloading v4l2convert.so, this camera works like a charm in skype.

All this should result in support for ALL webcams in ALL v4l(2) 
applications. Are there any objections against implementing this or any 
additions?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://archlinux.org/pipermail/arch-dev-public/attachments/20081015/e9b6bede/attachment.pgp>


More information about the arch-dev-public mailing list