Webcam with the Linux UVC driver
Prerequisites
- follow usb.essentials
- follow usb.video
| Name | Depends | Size | Description |
|---|---|---|---|
| mjpg-streamer | libpthread, libjpeg | 33738 | Streaming application for Linux-UVC compatible webcams |
The package motion is not available in the OpenWrt repositories. http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
Installation
opkg install kmod-video-uvc mjpg-streamer
Configuration
Usage
- start on boot
/etc/init.d/mjpg-streamer enable
- start
mjpg-streamerright now/etc/init.d/mjpg-streamer start
Now open the URL http://192.168.1.1:8080/ in the Firefox browser or VLC and watch the MJPEG stream. In other browsers, scripts, etc., you can use http://192.168.1.1:8080?action=snapshot for taking one image or http://192.168.1.1:8080?action=stream for stream of images.
[This command needed after my installation of trunk onto a WR703n as of 2012/09/24:
mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /www/webcam"&]
Embedding video stream into simple webpages
- Download a package located here and unpack it into /www/webcam_www directory.
- Edit /etc/init.d/mjpg-streamer - find this 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 and open the URL http://192.168.1.1:8080/ in your web browser.
Webcam Pan and Tilt Example with Microprocessor
Here is a writeup of using openWrt for a pan and tilt camera. The devices were NSLU2 for openWrt and Picaxe for microcontroller, but the idea is the same with arduino as micro and other openWrt devices:
http://www.picaxeforum.co.uk/showthread.php?13705
Grey day today here in Nova Scotia, you can see at http://www.lyzby.com/cam.html
Troubleshooting
If the control page doesn't contain any of the controls, edit the file /etc/init.d/mjpg-streamer and replace these lines
service_start /usr/bin/mjpg_streamer --input "input_uvc.so \
--device $device --fps $fps --resolution $resolution" \
--output "output_http.so --www $www --port $port"
by (on a single line )
service_start /usr/bin/mjpg_streamer --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --www $www --port $port"
The command mjpg_streamer -h give you usage information and examples.
The package uvc-streamer is no longer in the OpenWrt repositories.
Link Dump
doc/howto/webcam.txt · Last modified: 2013/04/10 22:02 by dz0rg
This text is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
