fswebcam

command-line webcam image capture

TLDR

Capture image
$ fswebcam [image.jpg]
Capture from specific device
$ fswebcam -d [/dev/video0] [image.jpg]
Set resolution
$ fswebcam -r [1280x720] [image.jpg]
Remove banner
$ fswebcam --no-banner [image.jpg]
Add timestamp
$ fswebcam --timestamp "%Y-%m-%d %H:%M" [image.jpg]
Set frame count for better quality
$ fswebcam -F [10] -S [5] [image.jpg]

SYNOPSIS

fswebcam [options] filename

DESCRIPTION

fswebcam is a small and simple command-line webcam capture utility. It captures images from V4L2 (Video4Linux) devices and saves them as JPEG or PNG files. Source modules include V4L2, V4L1, FILE, RAW, and TEST.The tool is useful for timelapse photography, security camera snapshots, and automated image capture. It supports overlays, timestamps, banners, and various image adjustments.

PARAMETERS

-d, --device dev

Video device (default /dev/video0).
-r, --resolution WxH
Capture resolution.
-F, --frames n
Capture n frames.
-S, --skip n
Skip n frames before capture.
--no-banner
Remove info banner.
--timestamp format
Add timestamp overlay.
--title text
Set banner title.
--subtitle text
Set banner subtitle.
-q, --quiet
Suppress output.
--png level
Save as PNG with compression level (0-9, or -1 for automatic).
--jpeg quality
JPEG quality (0-95, or -1 for automatic).
-i, --input input
Set the input to use (number or name, default "0").
--flip direction
Flip the image (h for horizontal, v for vertical).
--list-inputs
List available inputs for the selected source.
--list-controls
List available controls and their current values.

CONFIGURATION

~/.fswebcam

Optional configuration file for default settings.

INSTALL

sudo apt install fswebcam
sudo dnf install fswebcam
sudo zypper install fswebcam
nix profile install nixpkgs#fswebcam

CAVEATS

Requires V4L2 compatible webcam. Initial frames may be dark (use -S to skip). Resolution must be supported by camera. Some cameras need time to adjust exposure.

HISTORY

fswebcam was written by Philip Heron as a simple command-line tool for capturing webcam images on Linux. It's designed for scripting and automation rather than interactive use.

SEE ALSO

v4l2-ctl(1), ffmpeg(1), motion(1)