注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

心情挺好的博客

正在等你光临呢 呵呵

 
 
 

日志

 
 
关于我

喜欢摄影的朋友看过来:) 有时间就跟我一起去拍照去吧. QQ272751 上海圣玛丽摄影化妆培训学校 16年专业摄影培训化妆培训学校 电话:15900513500。 http://www.smlsh.com

网易考拉推荐

OpenWrt webCam  

2009-01-13 14:11:14|  分类: 技术 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Introduction

http://naaa.de/images/webcams.jpg

Attaching a webcam to your OpenWrt device is possible as long as you have the right connector and driver. Companies like Asus for example have integrated webcam support (ov511, pwc 8.11 --> low resultion only) to their stock firmware including motion detection and streaming (WL-500G-Deluxe). By installing the OpenWRT firmware it is possible to circumvent disadvantages like usage of ActiveX for the webcam stream, limited resoultion etc.

The steps

  • First step is to determine which driver can grab pictures from the webcam. Please consult the project websites to get a list of supported webcams or try to use them with a linux PC.
  • Install USB modules for your AP/Router device.
  • Install the V4L/V4L2 (video for linux) driver

  • Install webcam driver.
  • Install a programm that takes the video from the video device and turns them into a stream, or react to movements for instance.

Tested webcams

This sections should give an overview of tested (successfully or not) webcams. It just makes sense if YOU help to improve this wiki and table, so please share you experience.

Tested Webcams

Manufacturer

Name

USB-ID (Vendor:ID)

driver

OpenWrt Version

Hints and Comments

Logitech

Quickcam Sphere AF

046d:0994

Linux-UVC

Kamikaze trunk

Supports Pan/Tilt, has a very good resolution of up to 1600x1200 in YUYV mode and 960x720 in MJPEG-mode. Tested with UVC-streamer and MJPG-streamer. Requires very little CPU for streaming.

Philips

PWC 690


PWC

WR 0.9, Kamikaze trunk

works well with motion in 640x480

Philips

PWV 680


PWC

WR 0.9, Kamikaze trunk

works well with motion in 640x480

Typhoon

Webshot II USB 300k

10fd:0128

gspcav1

Kamikaze trunk

works in MJPG-mode with MJPG-streamer and with motion. Poor image quality, light sensitivity and resolution.

Mustek

Wcam3X

05a9:0511

OV511 kernel

Whiterussion

Motion and getjpeg ok; stay away from 51x, not after USB hub, AKA OmniVision Technologies, Inc. OV511 WebCam

























Webcams covered by PWC driver

Installing PWC for OpenWRT Whiterussian RC5

Most likely you want to install the package "motion" since it handles the most common usages like streaming AND motion detection at once. For instance, if you have a Asus WL-500g Premium running OpenWRT RC5 and you want to install a Philips Webcam (like PCVC690k) to it, enter the shell of the AP and perform the following commands:

  • ipkg install kmod-usb-core kmod-usb-ohci kmod-usb-uhci kmod-usb2 kmod-videodev

  • ipkg install http://naaa.de/programme/philips-webcam/philips-webcam_0.2_mipsel.ipk

  • reboot

The webcam can be accessed at http://<IP>/CamClient.html after the device has rebooted.

If you prefer MJPEG streams and motion detection at once (and a higher framerate of ~1 to 2 frames per second) use motion. A backported version of "motion" can be installed with the following command:

  • ipkg install kmod-usb-core kmod-usb-ohci kmod-usb-uhci kmod-usb2 kmod-videodev

  • ipkg install http://naaa.de/programme/philips-webcam/philips-webcam_0.2_mipsel.ipk

  • ipkg install http://naaa.de/programme/motion/libjpeg_6b-1_mipsel.ipk

  • ipkg install http://naaa.de/programme/motion/motion_3.2.6-1_mipsel.ipk

  • edit the /etc/init.d/S90webcam startup script and place a motion.conf file at /etc/motion.conf.

Do not expect to much performance like a real IP-Cam has. This solution will deliver one or two frames per second without audio. But on the other hand even cheap wired IP-Cam cost about 100 EUR,-. An Asus with webcam costs about the same but can do more things and is wireless.

Hint: The pwc, pwcx packages were just tested with Asus WL-500gP so far. There is no guarantee that your device will not break!

Important Hint: The video device will most likely be /dev/v4l/video0 instead of the common /dev/video0, due of the devfs. Just use the correct parameters when you invoke the programs since most assume it to be /dev/video0. You may want to symlink it with: 'ln -s /dev/v4l/video /dev/video0' as some apps will crash if they cannot find /dev/video0

Installing PWC for OpenWRT Whiterussian RC6

For RC6 use the backports reposititory. You will need to add a second source to the list of available packets as explained at thePackagespage. After adding the source you can even use the configuration webpage to install the packages (do not forget to update the list of available packages).

  • ipkg install kmod-usb-core kmod-usb-ohci kmod-usb-uhci kmod-usb2 kmod-videodev motion

  • edit the motion.conf file and reboot.

I recommend using motion for PWC cameras. Still the framerate is low due to the limited CPU but it is sufficient for most usages (1-3 fps).

Installing PWC for Kamikaze

Installing a PWC camera for Kamikaze is quite easy. You only need to make sure your router can access the official and backports package repositories from the internet. (backports is where palantir and motion packages are)

Installing neccecery packages

Log into the device and execute:

# ipkg update
# ipkg install kmod-usb-pwc kmod-videodev kmod-usb2

Now choose to install palantir and/or motion

Installing motion

# ipkg install motion

If you don't have backports in repositories use:

# ipkg install http://downloads.openwrt.org/backports/0.9/motion_3.2.6-1_mipsel.ipk
  • configure motion (/etc/motion.conf) and verify the start script was enabled

Installing palantir

# ipkg install palantir

If you don't have backports in repositories use:

# ipkg install http://downloads.openwrt.org/backports/0.9/palantir_2.6-1_mipsel.ipk
  • configure palantir (/etc/palantir.conf) and verify the configuration by executing:

# palantir -C /etc/palantir.conf

Webcams covered by the OV511 or OV51x driver

Whiterussian

It may already help you just to get the binary module. You can simply compile it yourself by entering the build_mipsel folder and execute the command make ARCH=mips menuconfig and compile the kernel. Then you can locate the module in a subfolder and copy it to your OpenWRT device.

Mark McClelland's driver for OV518, OV519 and OV530 cameras, from http://ovcam.org/ov511/

A package containing version 1.65-1.12 of the ov51x driver for whiterussian 0.9 is available at

This package contains the decompressor-moduls ov511_decomp and ov518_decomp.

This is NOT needed if you have a clean OV511 ! ( like the mustek) use the standard modules ( at least in whiterussian)v ov511 and videodev

You can use the getjpeg program that comes with to driver to capture images and save as JPEG files. A pre-compiled getjpeg is available at

Kamikaze

...

Webcams covered by the spca5xx driver

Many cameras are supported by the SPCA5XX driver. A few of them are able to send a MJPEG-Stream with many frames per second and only a few percent of CPU usage. Those webcams are labeled with a LE flag in the compatibility flag. If the webcam is supported by the special "embedded" driver with the LE suffix, you are lucky (or have purchased "the right device"). A list of cameras supported by the spca5xx driver can be found at

For Whiterussian there exists a tutorial on how to install prepared modules. You will not learn much about how to compile those modules, but it may be the fastest way to just setup a cam. If you are interested in compiling the modules yourself, you may be interested in the second subchapter that guides the way how to crosscompile the SPCA5XX-LE modules for Kamikaze.

A package containing version 20060501 of the spca5xx driver for whiterussian 0.9 is available at

also a package containing version 20060501 of the spca5xx/le driver for whiterussian 0.9 is available at

This package contains the driver-modul spca5xx_le, servfox-Streamserver, spcacat-Picturegrabber and a startup script /etc/init.d/S90webcam.

Binary modules for OpenWRT Whiterussian

A tutorial exists at http://www.macsat.com/macsat/content/view/36/30/. A sign up is required to download the binaries from that site. The tutorial is not quite correct, so please have a look at VideoSpca5xx

How To compile for OpenWRT Kamikaze 2.6.17

Will be improved, by now just the compiled sources for Kernel 2.6.17 mipsel for those who tried compilation without luck. Please help and create a patch to Kamikaze or improve this description.

Compile Kamikaze for Broadcom 2.6. The enter the temporary compile folder build_mipsel and enter the Kernel directory. The sources below were created by modifying the patch of SPCA5XX-LE for 2.6.12 Kernel. Basically there were issues with the folders and the Kconfig and makefile. A good guide how to do it right was the pwc folder, thats the reason why i put all entries close to the pwc statements in those files. You should understand the rest by reading BuildRoot. Sorry for such a short introduction...

Kamikaze: Install via package management

You can install the modules and applications likespcaserv etc withipkg.

Webcams covered by the quickcam messenger driver

A list of cameras supported by the quickcam messenger driver can be found at

A package containing version quickcam messenger driver for whiterussian rc6 is installable from

Webcams covered by Linux UVC driver

http://naaa.de/images/screenshot_mjpgstreamer.jpg

This gives the best results in terms of CPU/RAM usage versus frame rate, if the UVC cam supports jpeg compression. But UVC compatible cameras like Logitech QC Pro 5000 are quite cheap (~30 to 40 EUR) and give very impressive, good looking results.

The modules are available to Kamikaze > 7.07 and can be installed with ipkg:

ipkg install kmod-video-uvc kmod-usb2

To make use of such a webcam you need an application that stream the webcam picture. Such an application can be found at http://naaa.de/uvc_streamer.htm. It allows to stream a VGA M-JPEG with at least 15 fps. If you lower the fps, the camera will be more light-sensitive. The CPU consumption is very low, because the author decided to make use of the native JPEG encoding of the camera. Obviously he had embedded targets on his mind while deciding for the camera and writing the software for it :-). A package for Kamikaze is available.

ipkg install uvc-streamer

Here is a simple UCI configuration file and init script for the uvc-streamer (I'll add the scripts later to subversion):

/etc/config/uvc-streamer

config uvc-streamer
option device '/dev/video0'
option resolution '640x480'
option framespersecond '5'
option port '8080'
option enabled '1'

/etc/init.d/uvc-streamer

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=50
SSD=start-stop-daemon
NAME=uvc_stream
PIDF=/var/run/$NAME.pid
PROG=/sbin/$NAME
append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _val
config_get_bool _val "$section" "$option" '0'
[ "$_val" -gt 0 ] && append args "$3"
}
append_string() {
local section="$1"
local option="$2"
local value="$3"
local _val
config_get _val "$section" "$option"
[ -n "$_val" ] && append args "$3 $_val"
}
start_service() {
local section="$1"
args=""
append_string "$section" device "-d"
append_string "$section" resolution "-r"
append_bool "$section" framespersecond "-f"
append_string "$section" port "-p"
config_get_bool "enabled" "$section" "enabled" '1'
[ "$enabled" -gt 0 ] && $SSD -S -p $PIDF -q -x $PROG -- -b $args
}
stop_service() {
killall $NAME 2>&1 > /dev/null
# FIXME: Fix Busybox start-stop-daemon to work with multiple PIDs
# $SSD -K -p $PIDF -q
}
start() {
config_load "uvc-streamer"
config_foreach start_service "uvc-streamer"
}
stop() {
config_load "uvc-streamer"
config_foreach stop_service "uvc-streamer"
}

Compiled *.ipk files for Kamikaze 7.07 are available at:

Compiled *.ipk files for Kamikaze 7.09 and a HowTo for MJPG-streamer are available at:

Note that if you have a UVC camera that does not support native JPEG compression, it is still possible to get it to work. But then you cannot use uvc-streamer, instead use mjpg-streamer or motion. Configure the program to use YUV, and it will do JPEG-compression in software.

More Links

webcam (2008-12-15 21:53:47由xorcist编辑)

Almost all of these pages are editable, create an account and click the edit (Edit) button at the top of the page.

  评论这张
 
阅读(7406)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017