Fswebcam

From Fswiki

Jump to: navigation, search

fswebcam is a neat and simple command line webcam app. It is compatible with a wide range of cameras and devices, and features a number of simple effects.

fswebcam runs on Linux, with limited support for FreeBSD.

Contents

Download and Installation

The latest version of fswebcam is 20070108. For source and binary packages see http://www.firestorm.cx/fswebcam/

Fedora

fswebcam can be installed through 'Add/Remove Software', or using yum on the command line:

# yum install fswebcam

OpenBSD

fswebcam is available in the ports collection.

Configuration

Almost all of fswebcam's commands and options can be used on the command line, configuration file, or both. The only exception is the config command which can only be used on the command line. All options on the command line must be prefixed with two minus signs "--", for example:

# fswebcam --device /dev/video0 output.jpeg

...is the same as...

device /dev/video0
save output.jpeg

The save command isn't strictly necessary, but it helps readability.

Some of the more frequently used command line options have a short single character alias. See the man page for details.

Overlay

A PNG image can be drawn on the image when saving, either above or below the banner. This could be used for creating a custom banner or border for example.

  • You can't set more than one overlay or underlay at the same time.
  • The images are only applied when saving, so effects will not apply to them.
  • The images are always drawn at the top left.

Uploading

Once you've captured and prepared your image, you'll want to do something with it. The most common use for fswebcam is to upload the image to a public website for visitors to view. There are a number of ways to accomplish this:

ssh (scp)

device /dev/video0
save output.jpeg
exec "scp -qB output.jpeg user@remotehost:public_html/webcam.jpeg"

For this to work you will need to configure openssh not to prompt for a password each time an image is uploaded. See http://gentoo-wiki.com/SECURITY_SSH_without_a_password for more information.

ftp (ncftpput)

device /dev/video0
save output.jpeg
exec "ncftpput -V -f login.cfg -S .tmp output.jpeg webcam.jpeg"

Login details for the FTP server are stored in a file, here called login.cfg. For example:

host ftp.examplehost.com
user myusername
pass mypassword

ftp (curl)

device /dev/video0
save output.jpeg
exec "curl -s -T output.jpeg -u user:passwd ftp://ftp.examplehost.com/webcam.jpeg"

Device specific notes

Creative Optia AF

  • The auto-focus process may take a few seconds to complete so you'll need to skip some frames before capturing, or your images will be blurry.
  • The Linux UVC driver now has support for manual focus. Untested.
  • To capture at the highest resolution of this camera you need to force YUYV palette mode, for example:
    # fswebcam -d /dev/video1 -p YUYV -r 1600x1200 output.jpeg

Logitech Quickcam Fusion / Pro 5000

  • Certain versions of these cameras have a firmware bug that causes the camera to be unreliable, or worse completely locking up requiring it to be unplugged. Unfortunately there is no reliable solution to this yet. See http://www.quickcamteam.net/documentation/faq/logitech-webcam-linux-usb-incompatibilities for more information.
  • To capture at the highest resolutions of the Fusion you need to force YUYV palette mode, for example:
    # fswebcam -d /dev/video0 -p YUYV -r 1280x960 output.jpeg

Logitech Quickcam Pro 9000

  • To capture at the highest resolutions of this camera you need to force YUYV palette mode, for example:
    # fswebcam -d /dev/video0 -p YUYV -r 1600x1200 output.jpeg
  • These cameras have a manual focus control which is not accessible from the normal V4L2 controls fswebcam uses. For now you need to use the program uvcdynctrl (part of libwebcam) to control the focus. For example:
    uvcdynctrl -s Focus 80
Personal tools
projects