查看文章 |
Ubuntu 6.10 安装后记[十三]-Linux下的摄像头(webcam)驱动配置+WEB远程监控 2007-4-5
2007-04-05 22:13
Ubuntu 6.10 安装后记[十三]-Linux下的摄像头(webcam)驱动配置+WEB远程监控 作者: http://hi.baidu.com/uroot 2007.4.5 适用版本:Ubuntu 6.10 7.04 ? 7.10? 8.04 TLS ? 更新:8.04驱动配置成功。 For 8.04新驱动下载地址无法直接访问,请到 [Linux]webcam driver spca 5xxx 下载. Linux做桌面的最大乐趣就是:总有问题让你去解决,很有成就感。赫赫。我要把摄像头在Linux下用起来。于是乎Google了一下。好像需要用gspca 驱动就可以了,新立得里面的版本太低,到官方网站上下载一个最新版本试一下。 作者: http://hi.baidu.com/uroot 2007.4.5 1.下载驱动并安装 作者: http://hi.baidu.com/uroot 2007.4.5 http://mxhaard.free.fr/spca50x/Download/gspcav1-20070110.tar.gz (此网站不能访问。请使用 Tor +Firefox torbutton) 。 tar xfz gspcav1-20070110.tar.gz cd gspcav1-20070110 make make install depmod -a modprobe gspca 检查一下,是不是已经加载了这个模块,如果出现如下信息,表明正常 lsmod |grep spca spca5xx 637648 0 gspca 652112 0 videodev 10752 2 spca5xx,gspca usbcore 134912 7 spca5xx,gspca,usbhid,uhci_hcd,ehci_hcd,ohci_hcd 如果设备已经加载,应该有如下信息: ls -lh /dev/video0 crw-rw---- 1 root video 81, 0 2007-04-06 19:59 /dev/video0 相关命令: lshal - List devices and their properties Linux lshal |grep WebCam info.product = 'ZC0301 WebCam' (string) usb_device.product = 'ZC0301 WebCam' (string) lshal -s |grep usb lsusb 2.安装SpcaView http://mxhaard.free.fr/spca50x/Download/spcaview-20061208.tar.gz 编译spcaview需要libsdl,libsdl-dev 到新立得里装上。 make make install 后 装在了/usr/local/bin目录下. 运行如下命令: spcaview -d /dev/video0 -f jpg -s 320x240 是不是出现了一个视频窗口? 也可以 试试 cat /dev/video0 > pic.jpg -------------------------------- 正常工作的输出信息: spcaview -d /dev/video0 -f jpg -s 320x240 Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr size width: 320 height: 240 Initializing SDL. SDL initialized. bpp 3 format 21 Using video device /dev/video0. Initializing v4l. **************** PROBING CAMERA ********************* Camera found: Z-star Vimicro zc0301p Bridge found: ZC301-2 Bridge find ZC301-2 number 13 StreamId: JPEG Camera wrong spca5xx device Bridge find ZC301-2 number 13 Available Resolutions width 640 heigth 480 native Available Resolutions width 352 heigth 288 decoded Available Resolutions width 320 heigth 240 native * Available Resolutions width 176 heigth 144 decoded unable to probe size !! ***************************************************** grabbing method default MMAP asked VIDIOCGMBUF size 2457616 frames 2 offets[0]=0 offsets[1]=1228808 VIDIOCGPICT brightnes=32768 hue=0 color=0 contrast=32768 whiteness=0 depth=8 palette=4 VIDIOCSPICT brightness=32768 hue=0 color=0 contrast=32768 whiteness=0 depth=24 palette=21 Used 32461ms for 670 images => 48ms/image 20fps. Quiting SDL. Decoded frames:670 Average decode time: 11.000000 unmapping closing closed Destroy Picture thread ... Quiting.... --------------------------------------------------------------- 3.常见错误 如果运行spcaview命令后出现如下错误信息: spcaview -d /dev/video0 -f jpg -s 320x240 Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr size width: 320 height: 240 Initializing SDL. SDL initialized. bpp 3 format 21 Using video device /dev/video0. Initializing v4l. ERROR opening V4L interface : No space left on device . 参考地址中对此问题的解释和解决方案是: Problem When other USB devices are present on the same host controller bus as the camera, the bandwidth requirements of the spca5xx driver are not being met, with some hardware configurations. The spca5xx driver is asking for more bandwidth than is available which results in the following error messages: No space left on device can't open /dev/video0: No space left on device. There is a very good howto for the Spca5xx driver at https://help.ubuntu.com/community/Spca5xx if you haven't encountered the “No space left on device” error message. ----------------------------------------------- Solutions
说明:usb总线占用带宽不够, 让摄像头独占一个usb卡可以解决。如果无条件,可以参考参考地址中的方法2解决。因为我有个USB卡,所以,简单的让摄像头独占这个卡就解决了。 ------------------------------------------------------------------ 4.WEB远程监控 spcaserv -s 320x240 & spcaserv -h 配置httpd servercp -a http-java-applet ..../htdocs/cam 注:需要JAVA支持 cd .../htdocs/cam cp index-sample.html index.html chmod -R 755 *访问 http://your ip/cam/ OK 5.参考地址: Howto Fix the “No space left on device” error message and Install the Spca5xx driver http://ubuntuforums.org/showthread.php?t=247646 http://ubuntuforums.org/archive/index.php/t-78370.html 6.FAQ: https://help.ubuntu.com/community/Spca5xx ----------------------------------------------------------------------------------------- 相关链接: [Linux]Ubuntu 8.04 手写板(Tablet WP5540U)驱动配置成功 2008.8.16 ubuntu 6.10 安装后记(九)-iPod和数码摄像机在Linux上的使用初探-gtkpod和kino视频采集 |