|
天嵌MK 发表于 2013-4-12 13:24 
我的是普通的USB摄像头 如何知道 我的格式是什么
/* 获取当前视频设备支持的视频格式 */
struct v4l2_fmtdesc fmt;
memset(&fmt, 0, sizeof(fmt));
fmt.index = 0;
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
while (ioctl(fd, VIDIOC_ENUM_FMT, &fmt) == 0) {
fmt.index++;
printf("available pixelformat = \"%c%c%c%c\", description = \"%s\"\n",
fmt.pixelformat & 0xFF, (fmt.pixelformat >> 8) & 0xFF,
(fmt.pixelformat >> 16) & 0xFF, (fmt.pixelformat >> 24) & 0xFF,
fmt.description);
} |
|