5. Framegrabbing Applications

5.1. Xawtv

Xawtv is a suite of tools available for accessing video devices in linux, the workhorse of which is the Xawtv program itself. The home page is at http://bytesex.org/xawtv. You'll probably want to install an already packaged rpm, tgz or deb of xawtv; though, courageous or curious types can always get the latest source from the previous link.

When you first try out your webcam, and you think things are configured right, use the -hwscan option:

		$ xawtv -hwscan
		This is xawtv-3.72, running on Linux/i686 (2.4.21)
		looking for available devices

		/dev/v4l/video0: OK                     [ -device /dev/v4l/video0 ]
		type : v4l
		name : BT878(Hauppauge (bt878))
		flags: overlay capture tuner 

		/dev/v4l/video1: OK                     [ -device /dev/v4l/video1 ]
		type : v4l
		name : IBM USB Camera
		flags:  capture 
	

...so now you can see the available devices (your output may differ substantially). Try opening an xterm and running xawtv, grabbing from your webcam video device:

		$ xawtv -c /dev/video1  
		This is xawtv-3.72, running on Linux/i686 (2.4.21)
	

...and (hopefully) your camera will begin capturing to a window on your desktop. You may see some error messages in your xterm if things don't work that can be helpful to diagnose configuration problems. If you aren't interested in all that, and things work for you, launch from your window manager's menu next time. You can read about more xawtv options with man xawtv.

5.2. MoTV

MoTV is a rewrite of Xawtv using the Motif toolkit, and as such functions similarly to Xawtv. It looks more polished but otherwise differs very little from Xawtv. You can get it from the Xawtv home page.

5.3. Streamer

Streamer is a versatile program that allows a capture from a webcam or video device using only the command line. It may be in your Xawtv package already (or may need to be fetched separately as in Debian), and is available at the Xawtv homepage referenced in Section 5.1. It is a great program for automating camera functions. For example, to take a standard JPEG picture from the command line where the camera is accessed through /dev/video1:

		$ streamer -c /dev/video1 -b 16 -o outfile.jpeg
	

...where -b is the number of colors (in bpp, whether 15, 16, 24 or 32) and -o is the output filename that will be dropped into the current directory (specify -o /path/outfile.jpg to place it elsewhere).

To make an .avi file:

		$ streamer -q -c /dev/video1 -f rgb24 -r 3 -t 00:30:00 -o /home/jhs/outfile.avi
	

...where -q is for 'quiet' execution (no message output), -f is 'format' (rgb24 is TrueColor avi), -r is the frames per second and -t is the time of recording (30 minutes). Streamer can capture raw and Quicktime™ (non-Sorensen) formats and can capture audio as well. See streamer --help for more information.

5.4. Motion

Motion is a brilliant program that is able to monitor the video signal from one or several webcams. It can record periodic snapshots, and when motion is detected, record an mpeg and/or perform another action such as sending an email or executing a command. It can track and graphically mark the motion it detects, feed files via an http server to your website, stream them to another application and more. It is accessed through the command line and the number of options may be intimidating; there is however, a guide available online that outlines the various command and configuration file options nicely. The motion homepage can be found at http://motion.sourceforge.net.

5.5. Gqcam

Gqcam is a graphical GTK+-based application originally written to access Connectix QuickCams but now supports nearly all Video4Linux compatible webcam devices. It has an intuitive interface that makes viewing, taking snapshots, and configuring webcam settings blissfully easy. It is highly recommended for newbies and those who only want to look at the camera and take a picture here and there without editing a configuration file or using the command line.

5.6. camE

CamE is a command-line program that works in daemon mode to capture frames from your v4l device for archive or upload (to a webserver, for example) via ftp or scp. You can overlay other graphics, timestamp the frames, or add other dynamic text all by altering the appropriate line in the configuration file. See the camE homepage for more information.

5.7. SANE

SANE, or Scanner Access Now Easy, supports access of cameras including webcams in later versions. If you are familiar with using a photographic scanner device in Linux, you may be interested in using SANE for image capture, especially since a few devices double as both scanners and digital cameras. See the relevant sections of the Scanner-HOWTO here.