Streaming Web Cam on Netgear WGT634u Running OpenWRT

Posted by Max Power | Posted in Netgear WGT634u | Posted on 14-11-2011-05-2008

0

This post will help you to setup a usb web cam on your WGT634u, running OpenWrt Backfire, and stream the video to a website.  The important part is to make sure that your web cam is supported by the Linux UVC drivers.

Web Cam

First you need to make sure that your webcam is compatible with the Linux UVC drivers.  The following links will help you find out if your web cam is supported by Linux UVC drivers:

I am using a Logitech Quickcam Pro 5000 that I got on eBay for about $15.

Router Setup

It is probably easiest to connect to the router with the serial cable and putty serial, although it will probably work with putty over ssh as well.  It may be more difficult to trouble shoot though since you don’t see all of the command information.

Setup USB Support

Since the newer web cams are the ones that support UVC, they probably also support USB 2.  To get usb support install the following packages:

opkg update
opkg install kmod-usb-core kmod-usb2 usbutils

Running the following command should show you a list of the usb ports:

lsusb

http://wiki.openwrt.org/doc/howto/usb.essentials

Setup Webcam Support

Now we want to install support for the web cam.  Install the following packages:

opkg update
opkg install kmod-video-uvc kmod-input-core kmod-video-core kmod-i2c-core

http://wiki.openwrt.org/doc/howto/usb.video

MJPG-Streamer

Now we will install mjpg-streamer to stream the video to a website.  Install the following packages:

opkg update
opkg install mjpg-streamer

Now you can plug in the camera.  Use the

lsusb

to see if the web cam is recognized. If you are using the serial interface connected to the router you should be able to see the camera recognized. Now lets start mjpg-streamer

/etc/init.d/mjpg-streamer start

and browse to the website to see if it is working

http://192.168.1.1:8080/?action=stream (to see video)

http://192.168.1.1:8080/?action=snapshot (to see a still snapshot)

If you want mjpg-streamer to start up automatically then run this command:

/etc/init.d/mjpg-streamer enable

Website Setup

Download all of the files located here or download the tarball here and unpack it into /www/webcam_www directory.

Edit /etc/init.d/mjpg-streamer – find the following line in function start():

[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port" &

and add -w /www/webcam_www behind –output “output_http.so. Now it should look like this:

[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so -w /www/webcam_www --port $port" &

Now restart mjpg-streamer

/etc/init.d/mjpg-streamer restart

Then test it by opening the URL http://192.168.1.1:8080/in your web browser.

Refrences

Check out the following links for mjpg-setup details

http://wiki.openwrt.org/doc/howto/webcam#embedding.video.stream.into.simple.webpages

http://wiki.openwrt.org/doc/howto/webcam

Write a comment