linux下USB摄像头开发问题
我的摄像头在LINUX中安装应该是正常的
我用cat /dev/video0 >test.jpg& 是可以生成图片的。用lsusb查看USB设备如下
[root@lgfedora14 spcaview-20071224]# lsusb
Bus 002 Device 004: ID 0ac8:301b Z-Star Microelectronics Corp. ZC0301 Webcam
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
但用spcaserv就显示报错
[root@lgfedora14 spcaview-20071224]# spcaserv -d /dev/video0
Spcaview version: 1.1.8 date: 25:12:2007 (C) mxhaard@magic.fr
video /dev/video0
Camera found: PC Camera
VIDIOCGPICT brightnes=0 hue=0 color=0 contrast=32896 whiteness=39321depth=8 palette=0
Bridge found: zc3xx
Not an Spca5xx Camera !!
wrong spca5xx device
StreamId: -1 Camera
try palette 21 depth 8
Damned second try fail
try palette 15 depth 12
Damned second try fail
try palette 4 depth 24
Damned second try fail
try palette 3 depth 16
Damned second try fail
try palette 5 depth 32
Damned second try fail
probe size in
Available Resolutions width 640 heigth 480
Available Resolutions width 384 heigth 288
Available Resolutions width 352 heigth 288
Available Resolutions width 320 heigth 240
Available Resolutions width 192 heigth 144
Available Resolutions width 176 heigth 144
Available Resolutions width 160 heigth 120
Invalid palette in check palette fatal !!
Format asked 15 check -1
VIDIOCSPICT brightnes=0 hue=0 color=0 contrast=32896 whiteness=39321depth=12 palette=15
VIDIOCGPICT brightnes=0 hue=0 color=0 contrast=32896 whiteness=39321depth=8 palette=0
could't set video palette Abort !
我的程序也是用V4L库读设备信息也有问题如下,然后用ioctl(m_fd, VIDIOCMCAPTURE, &(mmap))就失败了
[2011-05-10 12:46:41]/dev/video0: v4l_get_capability PC Camera
1 channels
0 audios
maxwidth=640,maxheight=480,minwidth=48,minheight=32
[2011-05-10 12:46:41]Channel 0: type=CAMERA name=zc3xx flags=0 norm=0 tuners=0
[2011-05-10 12:46:41]/dev/video0: v4l_get_picture
brightness=0
colour =0
contrast =32896
depth =8
hue =0
palette=0
whiteness=39321