• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

contrib/H21-May-2020-28,97723,452

doc/H21-May-2020-248193

include/H03-May-2022-14,1997,675

lib/H21-May-2020-53,51334,278

libdvbv5-po/H21-May-2020-4,2493,328

m4/H21-May-2020-1,081981

utils/H21-May-2020-129,175108,786

v4l-utils-po/H21-May-2020-12,86810,247

COPYINGH A D21-May-202017.6 KiB342281

COPYING.libdvbv5H A D21-May-202025.8 KiB509431

COPYING.libv4lH A D21-May-202025.8 KiB511430

ChangeLogH A D21-May-2020182.9 KiB3,9743,682

INSTALLH A D21-May-20203.1 KiB10676

Makefile.amH A D21-May-20203.8 KiB6758

READMEH A D21-May-20207.3 KiB276184

README.lib-multi-threadingH A D21-May-2020520 139

README.libv4lH A D21-May-20208 KiB185137

TODOH A D21-May-20201.7 KiB5132

TODO.libdvbv5H A D21-May-2020139 33

aminclude.amH A D21-May-20204.6 KiB187135

android-config.hH A D03-May-202211.5 KiB364124

bootstrap.shH A D21-May-20201 KiB2919

configure.acH A D21-May-202022.3 KiB644547

doxygen_libdvbv5.cfgH A D21-May-2020100.5 KiB2,3521,823

v4l-utils.spec.inH A D21-May-202013.2 KiB390289

README

1v4l-utils
2---------
3
4Linux utilities and libraries to handle media devices (TV devices,
5capture devices, radio devices, remote controllers).
6
7You can always find the latest development v4l-utils in the git repo:
8	http://git.linuxtv.org/v4l-utils.git
9
10Those utilities follow the latest Linux Kernel media API, as documented
11at:
12	http://linuxtv.org/downloads/v4l-dvb-apis/
13
14Any questions/remarks/patches can be sent to the linux-media mailinglist.
15See https://linuxtv.org/lists.php for more information about the mailinglist.
16
17There is also a wiki page for the v4l-utils:
18
19	https://linuxtv.org/wiki/index.php/V4l-utils
20
21
22--------
23Building
24--------
25
26A number of packages is required to fully build v4l-utils. The first
27step is to install those packages. The package names are different on
28each distro.
29
30On Debian and derivated distributions, you need to install the following
31packages with apt-get or aptitude:
32	debhelper dh-autoreconf autotools-dev autoconf-archive
33        doxygen graphviz libasound2-dev
34	libtool libjpeg-dev qtbase5-dev libqt5opengl5-dev libudev-dev libx11-dev
35	pkg-config udev make gcc git
36
37
38On Fedora, the package list for a minimal install with dnf or yum is:
39	git automake autoconf libtool make gcc gcc-c++ which perl gettext-devel
40
41(git is only requiried if you're cloning from the main git repository at
42 linuxtv.org).
43
44And, to be able to compile it with all usual functionality with qt5,
45you'll need also:
46	alsa-lib-devel doxygen libjpeg-turbo-devel qt5-qtbase-devel
47	libudev-devel mesa-libGLU-devel
48
49
50After downloading and installing the needed packages, you should run:
51
52	./bootstrap.sh
53	./configure
54	make
55
56If ./configure exit with some errors try:
57
58	autoreconf -i --force
59	./configure
60
61And, to install on your system:
62	sudo make install
63
64Optional features
65^^^^^^^^^^^^^^^^^
66
67Please notice that there's an extra feature to add an extra table to
68decode Japanese DVB tables via iconv. This is meant to be used when
69the iconv itself doesn't come with the ARIB-STD-B24 and EN300-468-TAB00
70tables.
71
72That requires not only the gconv package, but it also needs to be manually
73enabled with:
74	--enable-gconv
75
76----------
77versioning
78----------
79
80The v4l-utils doesn't quite follow the release versioning defined
81at semver.org.
82
83Instead, since version 1.0, it uses:
84
85	MAJOR.MINOR.PATCH
86
87Where:
88
89	MINOR - an odd number means a development version. When
90		the development is closed, we release an even
91		numbered version and start a newer odd version;
92
93	MAJOR - It is incremented when MINOR number starts to be
94		too big. The last change occurred from 0.9.x to 1.0.
95
96	All numbers start with 0.
97
98All versions have their own tags, except for the current
99deveopment version (with uses the master branch at the git tree).
100
101The PATCH meaning actually depends if the version is stable
102or developent.
103
104For even MAJOR.MINOR versions (1.0, 1.2, 1.4, 1.6, ...)
105
106	PATCH is incremented when just bug fixes are added;
107
108For odd MAJOR.MINOR versions (1.1, 1.3, 1.5, 1.7, ...)
109	PATCH is incremented for release candidate versions.
110
111API/ABI stability:
112-----------------
113
114There should not have any API/ABI changes when PATCH is incremented.
115
116When MAJOR and/or MINOR are incremented, the API/ABI for the
117libraries might change, although we do all the efforts for not
118doing it, except when inevitable.
119
120The TODO files should specify the events that will generate
121API/ABI breaks.
122
123---------------
124media libraries
125---------------
126
127There are currently three media libraries defined at /lib directory,
128meant to be used internally and by other applications.
129
130libv4l
131------
132
133This library is meant to be used by applications that need to
134talk with V4L2 devices (webcams, analog TV, stream grabbers).
135
136It can be found on the following directories:
137	lib/libv4l1
138	lib/libv4l2
139	lib/libv4l-mplane
140	lib/libv4lconvert
141
142See README.libv4l for more information on libv4l.
143
144The libv4l is released under the GNU Lesser General Public License.
145
146libdvbv5
147--------
148
149This library is meant to be used by digital TV applications that
150need to talk with media hardware.
151
152Full documentation is provided via Doxygen. It can be built,
153after configuring the package, with:
154	$ make doxygen-run
155
156It is possible to generate documentation in html, man pages and pdf
157formats.
158
159The documentation is also available via web, at:
160	http://linuxtv.org/docs/libdvbv5/
161
162It can be found on the following directory:
163	lib/libdvbv5
164
165The libdvbv5 is released under GPL version 2.
166
167
168libv4l2rds
169----------
170
171This library provides support for RDS radio applications.
172
173It can be found on the following directory:
174	lib/libv4l2rds
175
176The libv4l is released under the GNU Lesser General Public License.
177
178---------
179Utilities
180---------
181
182The utilities are stored under /util directory.
183
184The (for now for v4l-utils private use only) libv4l2util library is
185released under the GNU Lesser General Public License, all other code is
186released under the GNU General Public License.
187
188v4l-utils includes the following utilities:
189
190decode_tm6000:
191Decodes tm6000 proprietary format streams.
192Installed by make install under <prefix>/bin.
193
194ir-keytable:
195Dump, Load or Modify ir receiver input tables.
196The ir tables for remotes which are known by the kernel
197(and loaded by default depending on dvb card type) can be found
198under utils/keytable/keycodes.
199v4l-keytable does not get installed by make install.
200
201ir-ctl:
202A swiss-knife tool to handle raw IR and to set lirc options
203
204qv4l2:
205QT v4l2 control panel application.
206Installed by make install under <prefix>/bin.
207
208rds-saa6588:
209Poll i2c RDS receiver [Philips saa6588].
210rds-saa6588 does not get installed by make install.
211
212v4l2-compliance:
213Tool to test v4l2 API compliance of drivers.
214Installed by make install under <prefix>/bin.
215
216v4l2-ctl:
217Tool to control v4l2 controls from the cmdline.
218Installed by make install under <prefix>/bin.
219
220v4l2-dbg:
221Tool to directly get and set registers of v4l2 devices,
222this requires a kernel >= 2.6.29 with the ADV_DEBUG option
223enabled. This tool can only be used by root and is meant
224for development purposes only!
225Installed by make install under <prefix>/sbin.
226
227v4l2-sysfs-path:
228FIXME add description.
229Installed by make install under <prefix>/bin.
230
231xc3028-firmware:
232Xceive XC2028/3028 tuner module firmware manipulation tool.
233xc3028-firmware does not get installed by make install.
234
235-------------------
236Syncing with Kernel
237-------------------
238
239There are a number of files on this package that depends on the Linux Kernel.
240
241In order to make easier to keep it in sync, there's a target on this
242package to do the synchronism.
243
244For the sync to work, you need to run it on with 64 bits userspace and
245be sure that glibc has the development package for 32 bits.
246
247For Fedora, this is provided via this package: glibc-devel.i686
248
249There are some steps required:
250
251step 1) at the Kernel git tree:
252
253We need to sanitize the headers to be installed. To do that, you should
254run
255
256	$ make headers_install INSTALL_HDR_PATH=usr/
257
258This will create the dir "usr/" inside the Kernel tree.
259
260step 2)
261
262Be sure that you have installed both glibc development packages for
26332 and 64 bits, as otherwise the next step will fail.
264
265step 3) at v4l-utils tree:
266
267	$ export KERNEL_DIR=location/of/the/kernel/tree make sync-with-kernel
268
269Alternatively, steps 1 to 3 can be replaced with:
270
271export KERNEL_DIR=location/of/the/kernel/tree && (cd $KERNEL_DIR && make headers_install INSTALL_HDR_PATH=usr/) && make sync-with-kernel
272
273step 4)
274
275Remove the usr/ from the Kernel tree.
276

README.lib-multi-threading

1libv4lconvert is not safe for using one convert instance as returned by
2v4lconvert_create from multiple threads, if you want to use one v4lconvert
3instance from multiple threads you must provide your own locking and make
4sure no simultaneous calls are made.
5
6libv4l1 and libv4l2 are safe for multithread use *under* *the* *following*
7*conditions* :
8
9* when using v4lx_fd_open, do not make any v4lx_ calls to the passed fd until
10  v4lx_fd_open has completed
11
12* all v4lx_ calls must be completed before calling v4lx_close
13

README.libv4l

1Introduction
2------------
3
4libv4l is a collection of libraries which adds a thin abstraction layer on
5top of video4linux2 devices. The purpose of this (thin) layer is to make it
6easy for application writers to support a wide variety of devices without
7having to write separate code for different devices in the same class.
8
9All libv4l components are licensed under the GNU Lesser General Public
10License version 2 or (at your option) any later version.
11
12libv4l consists of 3 different libraries:
13
14
15libv4lconvert
16-------------
17
18libv4lconvert started as a library to convert from any (known) pixelformat to
19V4l2_PIX_FMT_BGR24, RGB24, YUV420 or YVU420.
20
21The list of know source formats is large and continually growing, so instead
22of keeping an (almost always outdated) list here in the README, I refer you
23to the source, see the list of defines at the top of
24libv4lconvert/libv4lconvert.c for the full list.
25For more details on the v4lconvert_ functions see libv4lconvert.h.
26
27Later on libv4lconvert was expanded to also be able to do various video
28processing functions to improve webcam video quality on a software basis. So
29the name no longer 100% covers the functionality. The video processing is
30split in to 2 parts, libv4lconvert/control and libv4lconvert/processing.
31
32The control part is used to offer video controls which can be used to control
33the video processing functions made available by libv4lconvert/processing.
34These controls are stored application wide (until reboot) by using a
35persistent shared memory object.
36
37libv4lconvert/processing offers the actual video processing functionality.
38
39
40libv4l1
41-------
42
43This offers functions like v4l1_open, v4l1_ioctl, etc. which can by used to
44quickly make v4l1 applications work with v4l2 devices. These functions work
45exactly like the normal open/close/etc, except that libv4l1 does full emulation
46of the v4l1 api on top of v4l2 drivers, in case of v4l1 drivers it will just
47pass calls through. For more details on the v4l1_ functions see libv4l1.h .
48
49
50libv4l2
51-------
52
53This offers functions like v4l2_open, v4l2_ioctl, etc. which can by used to
54quickly make v4l2 applications work with v4l2 devices with weird formats.
55libv4l2 mostly passes calls directly through to the v4l2 driver. When the
56app does a TRY_FMT / S_FMT with a not supported format libv4l2 will get in
57the middle and emulate the format (if an app wants to know which formats the
58hardware can _really_ do it should use ENUM_FMT, not randomly try a bunch of
59S_FMT's). For more details on the v4l2_ functions see libv4l2.h .
60
61
62libdvbv5
63--------
64
65This library provides the DVBv5 API to userspace programs. It can be used to
66open DVB adapters, tune transponders and read PES and other data streams.
67There are as well several parsers for DVB, ATSC, ISBT formats.
68
69The API is currently EXPERIMENTAL and likely to change.
70Run configure with --enable-libdvbv5 in order to build a shared lib and
71install the header files.
72
73
74wrappers
75--------
76
77The functionality provided by libv4l1 for v4l1 apps and libv4l2 for v4l2 apps
78can also be used by existing apps without modifying them. For this purpose
792 wrapper libraries are provided which can be preloaded before starting the
80application using the LD_PRELOAD environment variable. These wrappers will
81then intercept calls to open/close/ioctl/etc. and if these calls directed
82towards a video device the wrapper will redirect the call to the libv4lX
83counterparts.
84
85The preloadable libv4l1 wrapper which adds v4l2 device compatibility to v4l1
86applications is called v4l1compat.so. The preloadable libv4l2 wrapper which
87adds support for various pixelformats to v4l2 applications is called
88v4l2convert.so.
89
90Example usage (after install in default location):
91$ export LD_PRELOAD=/usr/local/lib/libv4l/v4l1compat.so
92$ camorama
93
94
95Prerequisites
96-------------
97
98libv4l requires shmem file system support in the kernel (CONFIG_SHMEM).
99
100
101FAQ
102---
103
104Q: Why libv4l, whats wrong with directly accessing v4l2 devices ?
105Q: Do we really need yet another library ?
106A: Current webcam using applications like ekiga contain code to handle many
107different specific pixelformats webcam's use, but that code only supports a
108small subset of all native webcam (compressed) pixelformats. Other current
109v4l2 applications do not support anything but rgb pixelformats (xawtv for
110example) and this will not work with most webcams at all.
111
112With gspca being ported to v4l2 and thus decoding to normal formats being
113removed from the device driver as this really belongs in userspace, ekiga
114would need to be extended with many more often chip dependent formats, like
115the bayer compression used by the spca561 and the (different) compression used
116by the pac207 and the (again different) compression used by the sn9c102. Adding
117support for all these formats should not be done at the application level, as
118then it needs to be written for each application separately. Licensing issues
119with the decompressors will then also become a problem as just cut and pasting
120from one application to another is bound to hit license incompatibilities.
121
122So clearly this belongs in a library, and in a library with a license which
123allows this code to be used from as many different applications as possible.
124Hence libv4l was born.
125
126
127Q: Under which license may I use and distribute libv4l?
128A: The libv4l libraries are licensed under the GNU Library General Publishing
129License version 2 or (at your option) any later version. See the included
130COPYING.LIBV4L file. The decompression helpers are licensed under the GNU
131Library Publishing License version 2 (as they are derived from kernel code)
132
133
134Q: Okay so I get the use of having a libv4lconvert, but why libv4l1 ?
135A: Many v4l2 drivers do not offer full v4l1 compatibility. They often do not
136implemented the CGMBUF ioctl and v4l1 style mmap call. Adding support to all
137these drivers for this is a lot of work and more importantly unnecessary
138adds code to kernel space.
139
140Also even if the CGMBUF ioctl and v4l1 style mmap are supported, then most
141cams still deliver pixelformats which v4l1 applications do not understand.
142
143This libv4l1 was born as an easy way to get v4l1 applications to work with
144v4l2 devices without requiring full v4l1 emulation (including format
145conversion) in the kernel, and without requiring major changes to the
146applications.
147
148
149Q: Why should I use libv4l2 in my app instead of direct device access
150   combined with libv4lconvert?
151A: libv4l2 is mainly meant for quickly and easily adding support for more
152pixelformats to existing v4l2 applications. So if you feel better directly
153accessing the device in combination with libv4lconvert that's fine too.
154
155Notice that libv4l2 also does emulation of the read() call on devices which
156do not support it in the driver. In the background this uses mmap buffers
157(even on devices which do support the read call). This mmap gives libv4lconvert
158zero-copy access to the captured frame, and then it can write the converted
159data directly to the buffer the application provided to v4l2_read(). Thus
160another reason to use libv4l2 is to get the no memcpy advantage of the mmap
161capture method combined with the simplicity of making a simple read() call.
162
163
164Q: Where to send bugreports / questions?
165A: Please send libv4l questions / bugreports to the:
166   Linux Media Mailing List <linux-media@vger.kernel.org>
167   Subscription is not necessary to send mail to this list. If you're not
168   subscribed please put yourself in the CC of your original mail so you
169   will receive replies.
170
171Q: How do I port my application to libv4l1?
172A: Just replace the open call for your device by v4l1_open and all
173   following calls concerning this device file descriptor by their
174   counterpart v4l1_xxx (for a list see libv4l1.h).
175
176Q: How do I port my application to libv4l2?
177A: Just replace the open call for your device by v4l2_open and all
178   following calls concerning this device file descriptor by their
179   counterpart v4l2_xxx (for a list see libv4l2.h).
180
181Q: I still need an example how to convert my application!
182A: Check out the patches for the VLC media player:
183   https://trac.videolan.org/vlc/attachment/ticket/1804/vlc-0.8.6-libv4l1.patch
184   https://trac.videolan.org/vlc/attachment/ticket/1804/vlc-0.9.3-libv4l2.patch
185