wiki:

Capture

/

Webcam


Version 4 (modified by rogerdpack, 7 years ago) (diff)

--

Windows

For windows you should probably use the "dshow" input source. See here. You can also possibly use the (now out dated) vfwcap device.

Linux

On Linux, we can use video4linux2 input device to capture live input (such as web camera), like this:

ffmpeg -f video4linux2 -r 25 -s 640x480 -i /dev/video0 out.avi

If you need to set some specific parameters of your camera, you can do that using v4l2-ctl tool.

You can find it in ubuntu/debian package named v4l-utils.

Most probably you'll want to know what frame sizes / frame rates your camera supports and you can do that using: v4l2-ctl --list-formats-ext

Also, you might want to correct brightness, zoom, focus, etc. with:

v4l2-ctl -L

and

v4l2-ctl -c <option>=<value>