Is there a CLI webcam image grabber that works with a video4linux2 device?

From here

Streamer

Streamer (http://linux.bytesex.org/xawtv/) is a versatile program that allows a
capture from a webcam or video device using only the command line. It may be offered 
in your Linux distribution's Xawtv package. To install streamer try

# sudo apt-get install xawtv

To take a standard JPEG picture from the command line where the camera is accessed 
through /dev/video0:

#streamer -c /dev/video0 -b 16 -o outfile.jpeg

Where > -b is the number of colors (in bpp,whether 15, 16, 24 or 32)
& -o is the output filename in the current directory

If you are going to capture multiple images be sure to append the output file name 
with zeros, as streamer can name the capture files in sequence, i.e., -o 
outfile000.jpeg becomes outfile001.jpeg, outfile002.jpeg, and so on.  

From comments: streamer is not included in the xawtv package, sudo apt-get install streamer


I've done it with mplayer years ago, but can't remember exactly how. mplayer tv:// -tv driver=v4l2:input=1:width=352:height=288:device=/dev/video0 shows a live feed, but I'm convinced you can save it as jpg or png. Check the manual page.


Use fswebcam not with -o but with --save. -o tells where to write a logfile ...

example:

fswebcam --save /home/$USER/webcamGrab.jpg -d /dev/video1 -r 1280x960

Tags:

Video

Webcam