Archive

Posts Tagged ‘webcam’

Vedio Recording using webcam in any Linux Distro

October 14th, 2008

For vedio recording in linux, mplayer alone may not be enough, one additional package that comes with mplayer is needed. Its mencoder. To install mencoder in a debian based distro use the command

$sudo apt-get install mencoder

For other distros like redhat you can use relevant tools like YUM to install mencoder.

Then for vedio recording follow the commad below

Video Recording Without Sound

$ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -nosound -ovc lavc -o filename.avi

Video recording With Sound

$ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o filename.avi

To change/increase the rate of frames captured use the fps option of the above command.

Use it like

-fps 24

Rock with you webcam….

Bash, Linux

Accessing webcam in your Laptop in Hardy

June 23rd, 2008

Mplayer is a good movie player that supports almost all video and audio codecs. Mplayer can be used to view the output of the webcam also can be used to take the snaps using the web cam in your laptop.

The following is the command to view the output of the webcam

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 30

and to take the snaps (to capture each frame) as a picture use the following command.

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 30 -vo jpeg tv://

where fps specifies the frame rate in both cases. and this will determine the number of snaps taken per second.

This probably works with other destros also.. check it out….

To save the output as a vedio file you can use the mencoder command.

Also you can use XawTv package included by default in ubuntu for the above purpose.

Do write ur comments….

Ubuntu ,