I'd like to take a picture with my webcam on the command line with VLC.
The camera is a Microsoft XBox Live Vision camera that I picked up on a whim (it was $5) and it miraculously worked out-of-the-box on Linux.
The thing is, the first frame every time the camera turns on is half purple static. The next few frames are poorly lit as the camera calibrates to its lighting (yes, the webcam itself calibrates the brightness, entirely independently of the computer.)
What I want is to open the webcam, stream for 1 second (or even a set number of frames would be fine), then save the last frame as a JPEG. It's not necessary to open a window.
What would it take to do this?
ffmpeg -f v4l2 -i /dev/video0 -ss 1 -vframes 1 -qscale:v 2 output.jpg
? Of course change/dev/video0
to the actual name of your device. You may be able to adjust brightness or maybe even disable auto exposure withv4l2-ctl
.