libv4l is a collection of libraries that adds a thin abstraction layer on top of video4linux2 (V4L2) devices. The purpose of this layer is to make it easy for application writers to support a wide variety of devices without having to write separate code for different devices in the same class. It consists of 3 different libraries. libv4lconvert offers functions to convert from any (known) pixel format to V4l2_PIX_FMT_BGR24 or V4l2_PIX_FMT_YUV420. libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent of the drivers for those devices supporting v4l1 compatibility (which many v4l2 drivers do not). libv4l2 offers the v4l2 API on top of v4l2 devices, while adding support for the application transparent libv4lconvert conversion where necessary.
| Tags | multimedia Video Capture Software Development Libraries Hardware |
|---|---|
| Licenses | LGPL |
| Operating Systems | POSIX Linux |
| Implementation | C |
Recent releases


Changes: Support for software video processing was added, such as whitebalancing, automatic gain and exposure for cams which lack this in hardware, and gamma control. It also adds fake v4l2 controls to control all these as well as software flipping controls. Images from cameras known to be mounted upside down are flipped. Many other improvements, enhancements, and bugfixes were made.


Changes: Two bugs that were introduced in the previous beta release were resolved: black screens on devices with hardware gamma control, and crashes with devices for which fake controls are not emulated. Experimental support for libv4l on FreeBSD (using ported Linux webcam drivers) was added.


Changes: Software gamma correction as well as software auto gain and exposure were added. Support for separate v-flipping and h-flipping was added, along with fake controls for their software control. The ability to determine upside down cameras based on DMI info was added. A 320x240 resolution can now be provided to applications if the camera can only do 320x232. The video processing code was rewritten to make it easier to add more video filters. Several other minor changes, fixes, and tweaks were made.


Changes: Support for video processing was added, though currently only for whitebalance and normalizing. Only supported destination formats are now reported or allowed in enum_fmt(), try_fmt(), g_fmt(), and s_fmt() when processing, rotating, or flipping. Widths which are not a multiple of 8 are now cropped to the nearest multiple of 8 when converting to planar YUV. Support for the use of orientation info from VIDIOC_ENUMINPUT was added. Intermittent bad JPEG frames are now dropped. Upside down detection was fixed for the new V4L minor numbering scheme.


Changes: Support was added for MR97310A and sq905c decompression and for the cx2341x MPEG encoder devices.