Start your webcam from command-line


On Linux system, if you have integrated or external web-cam. Then you don’t need a extra software for configuring, capturing it.

VLC could do that for you.

$ vlc v4l2:///dev/video0

In above example v4l2 (Video for Linux 2) is module or protocol used to start capturing video. /dev/video0 is device node for your web-cam.

Once you launch this command, you can see vlc started capturing.

If you want to record it in file then,

$ vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-width=640 :v4l2-height=480 --sout "#transcode{vcodec=mpeg,acodec=mpga,vb=800,ab=128}:standard{access=file,dst=my.avi}"

On Ubuntu Linux system, there is a “cheese” software which can be used to manipulate web-cam. It internally uses gstreamer along with Video4Linux 2 API.

There are other tools which can be used to do all these thing like mplayer, FFmpeg, etc.



Post a Comment

You must be logged in to post a comment.
%d bloggers like this: