用qtopia自带的摄像头程序测试两种USB摄像头
第一种为yuyv格式输出的,大小640*480,采集大小320*240
[root@FriendlyARM wiggly]# usb 1-1.4: USB disconnect, address 13
usb 1-1.4: new full speed USB device using s3c2410-ohci and address 14
usb 1-1.4: New USB device found, idVendor=1871, idProduct=0316
usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.4: Product: USB2.0 Camera
usb 1-1.4: Manufacturer: AVEO Technology Corp.
usb 1-1.4: configuration #1 chosen from 1 choice
uvcvideo: Found UVC 1.00 device USB2.0 Camera (1871:0316)
[root@FriendlyARM wiggly]# ./wiggly-yuv-old -qws
open camera is sucess.fd=14.
camara driver: uvcvideo
camara card: USB2.0 Camera
camara bus info: usb-s3c24xx-1.4
camara version: 256
camara capabilities: 0x4000001
{ pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
Camara set fmt before width=320,height=240,pixelformat=YUYV,field=4.
Camara set fmt after width=320,height=240,pixelformat=YUYV,field=1.
v4l2_read_pic_use_time=1055.
v4l2_read_pic_use_time=543.
v4l2_read_pic_use_time=1055.
v4l2_read_pic_use_time=543.
不进行格式转换显示,只测试采集时间,采集时间代码如下:
time_test.start();
v4l2_read_pic();
printf("v4l2_read_pic_use_time=%d.\n",time_test.elapsed());
也就是输出为1秒1.5帧
若采集大小640*480,
v4l2_read_pic_use_time=1087.
v4l2_read_pic_use_time=1055.
v4l2_read_pic_use_time=1055.
v4l2_read_pic_use_time=1087.
v4l2_read_pic_use_time=1055.
v4l2_read_pic_use_time=1056.
也就是采集时间为1秒1帧。
第二种为ANC摄像头zc301,输出的是jpeg格式,大小320*240[root@FriendlyARM wiggly]# usb 1-1.4: USB disconnect, address 14
usb 1-1.4: new full speed USB device using s3c2410-ohci and address 15
usb 1-1.4: New USB device found, idVendor=058f, idProduct=9254
usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.4: Product: Generic USB Hub
usb 1-1.4: Manufacturer: ALCOR
usb 1-1.4: configuration #1 chosen from 1 choice
hub 1-1.4:1.0: USB hub found
hub 1-1.4:1.0: 4 ports detected
usb 1-1.4.1: new full speed USB device using s3c2410-ohci and address 16
usb 1-1.4.1: New USB device found, idVendor=0ac8, idProduct=301b
usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.4.1: Product: PC Camera
usb 1-1.4.1: Manufacturer: Vimicro Corp.
usb 1-1.4.1: configuration #1 chosen from 1 choice
gspca: probing 0ac8:301b
zc3xx: probe sensor -> 000a
zc3xx: Find Sensor PB0330. Chip revision 0
gspca: probe ok
[root@FriendlyARM wiggly]# ./myusbcamera-thread-yuv -qws
open camera is sucess.fd=14.
camara driver: zc3xx
camara card: PC Camera
camara bus info: usb-s3c24xx-1.4.1
camara version: 132864
camara capabilities: 0x5000001
{ pixelformat = 'JPEG', description = 'JPEG' }
Camara set fmt before width=640,height=480,pixelformat=YUYV,field=4.
Camara set fmt after width=640,height=480,pixelformat=JPEG,field=1.
open style fail.
v4l2_read_pic_use_time=351.
v4l2_read_pic_use_time=383.
v4l2_read_pic_use_time=378.
v4l2_read_pic_use_time=383.
v4l2_read_pic_use_time=349.
v4l2_read_pic_use_time=382.
v4l2_read_pic_use_time=382.
[root@FriendlyARM wiggly]# ./myusbcamera-thread-yuv-test-read-time -qws
open camera is sucess.fd=14.
camara driver: zc3xx
camara card: PC Camera
camara bus info: usb-s3c24xx-1.4.1
camara version: 132864
camara capabilities: 0x5000001
{ pixelformat = 'JPEG', description = 'JPEG' }
Camara set fmt before width=320,height=240,pixelformat=YUYV,field=4.
Camara set fmt after width=320,height=240,pixelformat=JPEG,field=1.
v4l2_read_pic_use_time=159.
v4l2_read_pic_use_time=190.
v4l2_read_pic_use_time=256.
v4l2_read_pic_use_time=255.
v4l2_read_pic_use_time=288.
[root@FriendlyARM wiggly]#
可以看出320*240输出为1秒4帧左右。
有没有朋友一起分析下原因!
[ 此帖被xphyym在2011-04-22 09:00重新编辑 ]