liunx环境,摄像头无法识别,解决方案
今天无语了,linux14.04系统下,使用罗技c270摄像头。发现插上没有反应,系统版本:
lenovo-myc@lenovomyc-Lenovo-Product:~/Downloads$ uname -a
Linux lenovomyc-Lenovo-Product 3.13.--generic #-Ubuntu SMP Wed Jul :: UTC x86_64 x86_64 x86_64 GNU/Linux
找了一上午UVC驱动,最后发现是测试摄像头的程序cheese刚刚有点问题
---------------------------------------------------这是分割线----------------------------------------------------
下载了luvcview, 运行,正常工作
lenovo-myc@lenovomyc-Lenovo-Product:~/Downloads$ sudo apt-get install luvcview
Reading package lists... Done
Building dependency tree
Reading state information... Done
luvcview is already the newest version.
upgraded, newly installed, to remove and not upgraded.
lenovo-myc@lenovomyc-Lenovo-Product:~/Downloads$ luvcview
luvcview 0.2. SDL information:
Video driver: x11
A window manager is available
Device information:
Device path: /dev/video0
Stream settings:
Frame format: MJPG
Frame size: 640x480
Frame rate: fps
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
find DRI
---------------------------------------------------以下是上午进行的尝试---------------------------------------------------
(1)判断是否为UVC设备
http://blog.csdn.net/myarrow/article/details/8465384
判断一个摄像头是否属于UVC规范可以使用下面方法:
1.使用lsusb命令或其它硬件信息查看工具找出摄像头的设备号(Vendor ID)和产品号(Product ID)。如Logitech Quickcam for Notebooks Pro摄像头是046d:08cb;
2.查找是否有视频类接口信息
lsusb -d 046d:08cb -v | grep "14 Video"
如果该摄像头兼容UVC,则会输出类似信息
bFunctionClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video
若无以上信息,则是non-UVC设备。
(2) uvc官网 http://www.ideasonboard.org/uvc/ 有说明:
Linux 2.6.26 and newer includes the Linux UVC driver natively. You will not need to download the driver sources manually unless you want to test a newer version or help with development.
就是说:linux 2.6.26 以及高版本内核都自带UVC驱动的。还以为系统有问题
系统目录下也有 /dev/video0 文件,说明摄像头驱动正常
lsusb输出当前usb设备
罗技C270 为 046d:0825
lenovo-myc@lenovomyc-Lenovo-Product:/dev$ lsusb
Bus Device : ID 046d: Logitech, Inc. Webcam C270
Bus Device : ID : Intel Corp. Integrated Rate Matching Hub
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
Bus Device : ID 17ef: Lenovo
Bus Device : ID : Intel Corp. Integrated Rate Matching Hub
Bus Device : ID 1d6b: Linux Foundation 2.0 root hub
(3)ubuntu下使用UVC摄像头 http://blog.csdn.net/xingyu19871124/article/details/5764954
分别下载了
1、v41-dvb
网址:http://linuxtv.org/hg/v4l-dvb/ make的时候出错,版本不匹配。是针对linux 3.3.0版本编译的, 当前版本为3.13.0 报错:
UVC File not found: /lib/modules/3.3.0-61-generic/build/.config
又根据:
http://blog.sina.com.cn/s/blog_3dc687f30100kwf5.html
尝试 make config 依旧不行,放弃
重新clone了一遍源码
lenovo-myc@lenovomyc-Lenovo-Product:/dev$ git clone git://linuxtv.org/media_build.git
make (编译内核 。。。)
lenovo-myc@lenovomyc-Lenovo-Product:~/Downloads/media_build$ make
make -C /home/lenovo-myc/Downloads/media_build/v4l
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/v4l'
Updating/Creating .config
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/linux'
Applying patches for kernel 3.13.--generic
patch -s -f -N -p1 -i ../backports/api_version.patch
patch -s -f -N -p1 -i ../backports/pr_fmt.patch
patch -s -f -N -p1 -i ../backports/debug.patch
patch -s -f -N -p1 -i ../backports/drx39xxj.patch
patch -s -f -N -p1 -i ../backports/v4.1_pat_enabled.patch
patch -s -f -N -p1 -i ../backports/v4.0_dma_buf_export.patch
patch -s -f -N -p1 -i ../backports/v4.0_drop_trace.patch
patch -s -f -N -p1 -i ../backports/v3.16_netdev.patch
patch -s -f -N -p1 -i ../backports/v3.16_wait_on_bit.patch
patch -s -f -N -p1 -i ../backports/v3.16_void_gpiochip_remove.patch
Patched drivers/media/dvb-core/dvbdev.c
Patched drivers/media/v4l2-core/v4l2-dev.c
Patched drivers/media/rc/rc-main.c
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/linux'
Preparing to compile for kernel version 3.13. ***WARNING:*** You do not have the full kernel sources installed.
This does not prevent you from building the v4l-dvb tree if you have the
kernel headers, but the full kernel source may be required in order to use
make menuconfig / xconfig / qconfig. If you are experiencing problems building the v4l-dvb tree, please try
building against a vanilla kernel before reporting a bug. Vanilla kernels are available at http://kernel.org.
On most distros, this will compile a newly downloaded kernel: cp /boot/config-`uname -r` <your kernel dir>/.config
cd <your kernel dir>
make all modules_install install Please see your distro's web site for instructions to build a new kernel. WARNING: This is the V4L/DVB backport tree, with experimental drivers
backported to run on legacy kernels from the development tree at:
http://git.linuxtv.org/media-tree.git.
It is generally safe to use it for testing a new driver or
feature, but its usage on production environments is risky.
Don't use it in production. You've been warned.
V4L2_FLASH_LED_CLASS: Requires at least kernel 4.2.
RC_ST: Requires at least kernel 3.15.
VIDEO_XILINX: Requires at least kernel 3.17.
I2C_SI4713: Requires at least kernel 3.17.
VIDEO_ADV7604: Requires at least kernel 3.17.
VIDEO_MT9P031: Requires at least kernel 3.17.
VIDEO_MT9V032: Requires at least kernel 3.19.
VIDEO_SMIAPP: Requires at least kernel 4.0.
SOC_CAMERA_OV2640: Requires at least kernel 3.17.
Created default (all yes) .config file
./scripts/make_myconfig.pl
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/v4l'
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/v4l'
perl scripts/make_config_compat.pl /lib/modules/3.13.--generic/build ./.myconfig ./config-compat.h
creating symbolic links...
make -C firmware prep
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/v4l/firmware'
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/v4l/firmware'
make -C firmware
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/v4l/firmware'
Generating vicam/firmware.fw
Generating ttusb-budget/dspbootcode.bin
Generating cpia2/stv0672_vp4.bin
Generating av7110/bootcode.bin
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/v4l/firmware'
Kernel build directory is /lib/modules/3.13.--generic/build
make -C ../linux apply_patches
make[]: Entering directory `/home/lenovo-myc/Downloads/media_build/linux'
Patches for 3.13.--generic already applied.
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/linux'
make -C /lib/modules/3.13.--generic/build SUBDIRS=/home/lenovo-myc/Downloads/media_build/v4l modules
make[]: Entering directory `/usr/src/linux-headers-3.13.--generic'
CC [M] /home/lenovo-myc/Downloads/media_build/v4l/bt87x.o
LD [M] /home/lenovo-myc/Downloads/media_build/v4l/snd-bt87x.o
Building modules, stage .
MODPOST modules
CC /home/lenovo-myc/Downloads/media_build/v4l/snd-bt87x.mod.o
LD [M] /home/lenovo-myc/Downloads/media_build/v4l/snd-bt87x.ko
make[]: Leaving directory `/usr/src/linux-headers-3.13.--generic'
./scripts/rmmod.pl check
Can't locate Proc/ProcessTable.pm in @INC (you may need to install the Proc::ProcessTable module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ./scripts/rmmod.pl line 4.
BEGIN failed--compilation aborted at ./scripts/rmmod.pl line .
make[]: *** [default] Error
make[]: Leaving directory `/home/lenovo-myc/Downloads/media_build/v4l'
make: *** [all] Error
2、gspcav1-20071224.tar.gz
网址:http://mxhaard.free.fr/download.html
make依旧出错
后来下载了 luvciew。发现摄像头可以运行! 好吧,到此结束
---------------------------------------------------other---------------------------------------------------
1、查看摄像头ID:
[root@151 dev]# lsusb
Bus 002 Device 013: ID 0ac8:3313 Z-Star Microelectronics Corp.
0xc8:3313在UVC中支持了。
2、插入摄像头后,就可以在/dev/下查看是否有video设备文件:
[root@151 dev]# ls | grep video
video
video0
其中,video是video0的连接。如果没有再现,可能UVC没有配置到内核中,重新配置就可以了
(大致在Device DriversàMultimedia devicesàVideo capture adaptersàV4L USB devices下面)。如果内核配置了,
还是不出现,可以使用modprobe uvcvideo来加载该模块。
3、先看看摄像头的相关信息:
lshal | grep Cam
出现:
info.product = 'Vega USB 2.0 Camera.' (string)
usb_device.product = 'Vega USB 2.0 Camera.' (string)
usb.interface.description = 'Vega USB 2.0 Camera.' (string)
info.product = 'Vega USB 2.0 Camera.' (string)
input.product = 'Vega USB 2.0 Camera.' (string)
info.product = 'Vega USB 2.0 Camera.' (string)
对USB有研究的,就很熟悉这些字段。
再看一下系统能不能识别出摄像头:
[root@151 log]# dmesg | grep Cam
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
input: Vega USB 2.0 Camera. as /class/input/input6
usb 2-7: Product: Vega USB 2.0 Camera.
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
input: Vega USB 2.0 Camera. as /class/input/input7
usb 2-7: Product: Vega USB 2.0 Camera.
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
input: Vega USB 2.0 Camera. as /class/input/input8
usb 2-7: Product: Vega USB 2.0 Camera.
[root@151 ~]# dmesg | grep video
pci 0000:05:00.0: Boot video device
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
uvcvideo 2-7:1.0: usb_probe_interface
uvcvideo 2-7:1.0: usb_probe_interface - got id
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
uvcvideo 2-7:1.0: usb_probe_interface
uvcvideo 2-7:1.0: usb_probe_interface - got id
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
uvcvideo 2-7:1.0: usb_probe_interface
uvcvideo 2-7:1.0: usb_probe_interface - got id
uvcvideo: Found UVC 1.00 device Vega USB 2.0 Camera. (0ac8:3313)
liunx环境,摄像头无法识别,解决方案的更多相关文章
- Liunx 环境下vsftpd的三种实现方法(超详细参数)
以下文章介绍Liunx 环境下vsftpd的三种实现方法 ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.0.3.tar.gz,目前已经到2.0.3版本.假 ...
- python之web自动化验证码识别解决方案
验证码识别解决方案 对于web应用程序来讲,处于安全性考虑,在登录的时候,都会设置验证码,验证码的类型种类繁多,有图片中辨别数字字母的,有点击图片中指定的文字的,也有算术计算结果的,再复杂一点就是滑动 ...
- apollo在liunx环境实战(三)
1. apollo在liunx环境实战(三) 1.1. 准备 下载apollo源码 https://github.com/ctripcorp/apollo 1.2. 创建数据库 在自己的liunx环境 ...
- 项目部署到liunx环境下访问接口返回异常
1.访问接口返回异常 已经连续踩了两次这个坑了.所以记下来了.方便下次搜索! 项目在window下运行正常,无任何异常! 但是部署到liunx环境下的服务器上就有问题 访问静态页面毫无问题,一旦涉及到 ...
- Python3利用Dlib19.7实现摄像头人脸识别的方法
0.引言 利用python开发,借助Dlib库捕获摄像头中的人脸,提取人脸特征,通过计算欧氏距离来和预存的人脸特征进行对比,达到人脸识别的目的: 可以自动从摄像头中抠取人脸图片存储到本地,然后提取构建 ...
- liunx环境下安装禅道
环境: vm12.5.2 CentOS-7-x86_64 ZenTaoPMS.9.1.stable.zbox_64 SecureCRT 8.0 因为liunx环境下配置apache, php, mys ...
- VMware vRealize Suite 8.4 发布 - 多云环境的云计算管理解决方案
VMware vRealize Suite 8.4.0, Release Date: 2021-04-15 概述 VMware vRealize Suite 是一种多云环境的云计算管理解决方案,为 I ...
- VMware vRealize Suite 8.3 发布 - 多云环境的云计算管理解决方案
概述 VMware vRealize Suite 是一种多云环境的云计算管理解决方案,为 IT 组织提供了一个基于 DevOps 和 ML 原则的基础架构自动化.一致运维和监管的现代平台. vReal ...
- OpenCV摄像头人脸识别
注: 从外设摄像装置中获取图像帧,把每帧的图片与人脸特征进行匹配,用方框框住识别出来的人脸 需要用到的函数: CvHaarClassifierCascade* cvLoadHaarClassifier ...
随机推荐
- codeforces 777C.Alyona and Spreadsheet 解题报告
题目链接:http://codeforces.com/problemset/problem/777/C 题目意思:给出一个 n * m 的矩阵,然后问 [l, r] 行之间是否存在至少一列是非递减序列 ...
- PromiseJs
(function() { var define, requireModule, require, requirejs; (function() { var registry = {}, seen = ...
- Handsontable-一款仿 Excel效果的表格插件使用总结 96
最近在做一个关于报表管理的项目,发现了一款很好用的jQuery插件-Handsontable.它真的特别给力,在 Excel 中可进行的操作,你几乎都可以在网页中做到,如拖动复制.Ctrl+C .Ct ...
- js操作获取和设置cookie
//创建cookie function setCookie(name, value, expires, path, domain, secure) { var cookieText = encodeU ...
- C# WebApi 配置复杂路由不生效的问题
配置复杂路由不生效是由于优先级的关系,应该把默认路由放在最后. config.Routes.MapHttpRoute( name: "DynamicApi", routeTempl ...
- HihoCoder1139 二分·二分答案
描述 在上一回和上上回里我们知道Nettle在玩<艦これ>,Nettle在整理好舰队之后终于准备出海捞船和敌军交战了.在这个游戏里面,海域是N个战略点(编号1..N)组成,如下图所示其中红 ...
- Effective Python之编写高质量Python代码的59个有效方法
这个周末断断续续的阅读完了<Effective Python之编写高质量Python代码 ...
- LeetCode 298. Binary Tree Longest Consecutive Sequence
原题链接在这里:https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/ 题目: Given a binary t ...
- Oracle中查询前10条记录
在Oracle怎样查询表中的top10条记录呢? select * from test where rownum <=10 ----说明:rownum只能用于<或<=运算,如 ...
- Dubbo与Zookeeper
ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件.它是一个为分布式应用提供一致性服务的软件,提供的功 ...