Version 5 (modified by burek, 7 years ago) (diff)

avoid using external tutorials if possible, since links do brake often


For windows you should probably use the "dshow" input source, like this:

ffmpeg -f dshow -r 25 -s 640x480 -i video="USB2.0_Camera":audio="Microphone (USB Audio Device)" output.avi

You can also possibly use the (now out dated) vfwcap device.


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


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