Monitor a Webcam
Plug in your webcam
Before you plug in your webcam, try the following command at a console:
ls /dev/video*
I don't have any video devices on my system so I get:
No such file or directory
Plug in your webcam
List the USB devices using
sudo lsusb
You should see something like this.
Bus 001 Device 005: ID 1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation Eye Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 05e3:0660 Genesys Logic, Inc. USB 2.0 Hub Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: shows a USB Playstation Eye has been recognised.
Repeat the first command and make a note of the new devices names.
ls /dev/video*
Now we get
/dev/video0
This means the device has automatically been detected and recognised by the system. It doesn't mean you have a means of watching the video data, not yet.
Watch the Video
First we're going to need some video capture tools
MPlayer is capable of displaying a webcam video stream.
MEncoder can record from a webcam to video files. The companion to MPlayer,
FFmpeg is a cross-platform audio/video recording, conversion and streaming application.
sudo apt-get install mplayer mencoder ffmpeg
Troubleshooting
- USB Camera not detected.
- The RPi has limited capability to supply power to USB devices, try again using a powered USB hub.
Tested
Linux raspberrypi 3.1.9+ #95 PREEMPT Thu May 31 13:21:40 BST 2012 armv6l GNU/Linux