Sunday, March 9, 2014

Webcam on Raspberry Pi

I want to set up a remote webcam using the Raspberry Pi.  I installed a fresh copy of Raspian (2014-01-07-wheezy-raspbian.zip) from the Raspberry Pi download page.

Then, I followed the directions here.

First, update the raspberry pi firmware using rpi-update to add support for USB video device class (UVC).  I was not sure if this was needed or not.  My device already showed up in the usb device list using the lsusb command.

$ sudo apt-get install rpi-update
$ sudo rpi-update

After this is done, reboot.  Next, update the OS.
$ sudo apt-get update
$ sudo apt-get upgrade

Then install motion.
$ sudo apt-get install motion

After installation, I noted that it will not start by default.  It was disabled via /etc/default/motion.  After motion is installed, configure it by editing the  /etc/motion/motion.conf file (with elevated privileges).  I turned webcam_localhost and control_localhost to off so that I could view the stream and control the camera from a remote host.  I enabled motion by editing the
/etc/default/motion file and changing start_motion_daemon to yes.

Then, I was able to start motion.
$ sudo service motion start

I went to another machine and use VLC to open the stream by selecting "Open Network Steam" and putting in "http://<ip_address>:<port>.  In my case, the port was the default 8081, and the ip address was the address of the Raspberry Pi.

Unfortunately, I got a video stream that said "UNABLE TO OPEN VIDEO DEVICE."  Now I have to figure out why that didn't work. 
 

No comments:

Post a Comment