Nowadays it is increasingly common to find laptops or monitors that incorporate a webcam. These devices can be used to make videos in more or less decent quality, depending on the webcam we have.
In this article, I will explain how to make recordings through mencoder and how to view the captured video in real-time from the webcam.
To make the recordings, it is enough to specify the video device:
mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -nosound -ovc lavc -o wcrecording.avi
To play in real-time what the webcam is capturing:
mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0
If you have more than one webcam, you can select the appropriate one by changing /dev/video0 to /dev/videoX.