精华内容
下载资源
问答
  • Linux UVC driver

    千次阅读 2019-04-18 10:23:04
    Linux UVC driver

    首先给大家分享一个巨牛巨牛的人工智能教程,是我无意中发现的。教程不仅零基础,通俗易懂,而且非常风趣幽默,还时不时有内涵段子,像看小说一样,哈哈~我正在学习中,觉得太牛了,所以分享给大家!点这里可以跳转到教程

                   

    1. 如何判断Camera是否为UVC Camera

           Linux UVC driver(uvc) 该驱动适用于符合USB视频类(USB Video Class)规范的摄像头设备,它包括V4L2内核设备驱动和用户空间工具补丁。大多数大容量存储器设备(如优盘)都遵循USB规范,因而仅用一个单一驱动就可以操作它们。与此类似,UVC兼容外设只需要一个通用驱动即可。

      USB摄像头大体上可以分为UVC cameras和non-UVC cameras。推荐购买UVC cameras。UVC是一个开放的标准,拥有维护良好的驱动,它属于内核代码的一部分。插入摄像头后就可以工作,而无须编译或安装额外的驱动。non- UVC cameras通常情况下不比UVC cameras工作出色,前者的驱动并不遵循通用的协议,需要针对每种摄像头做出单独的处理,这往往需要一个逆向工程的探索过程。

      判断一个摄像头是否属于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设备。

      项目主页:http://www.ideasonboard.org/uvc/ 

           USB Video Class Specification: http://www.usb.org/developers/devclass_docs

         

     

     

     


               

    浏览人工智能教程

    展开全文
  • Linux UVC Gadget数据结构

    2021-06-29 15:22:48
    UVC Gadget数据结构思维导图
  • 至于从哪个版本开始内核支持UVC,官方的话是“Linux 2.6.26 and newer includes the Linux UVC driver natively.” 1、查看摄像头ID: [root@151 dev]# lsusb Bus 002 Device 013: ID 0ac8:3313 Z-Star ...

    至于从哪个版本开始内核支持UVC,官方的话是“Linux 2.6.26 and newer includes the Linux UVC driver natively.”

    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

    You can install HAL from the PPA.

    sudo add-apt-repository ppa:mjblenner/ppa-hal
    sudo apt-get update
    sudo apt-get install hal
    

    https://www.binarytides.com/linux-commands-hardware-info/

    转载于:https://www.cnblogs.com/SZLLQ2000/p/8481836.html

    展开全文
  • 本文基于AM6C平台Linux...1.drivers/media/video/uvc/Makefileuvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \uvc_status.o uvc_isight.oobj-$(CONFIG_USB_VIDEO_CLASS) += uvcvide...

    本文基于AM6C平台Linux3.0.8内核。

    1.drivers/media/video/uvc/Makefile

    uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \

    uvc_status.o uvc_isight.o

    obj-$(CONFIG_USB_VIDEO_CLASS) += uvcvideo.o

    2.drivers/media/video/uvc/uvc_driver.c

    module_init(uvc_init);

    static int __init uvc_init(void){

    ......

    result = usb_register(&uvc_driver.driver);

    ......

    }

    struct uvc_driver uvc_driver = {

    .driver = {

    .name = "uvcvideo",

    .probe = uvc_probe,

    .disconnect = uvc_disconnect,

    .suspend = uvc_suspend,

    .resume = uvc_resume,

    .reset_resume = uvc_reset_resume,

    .id_table = uvc_ids,

    .supports_autosuspend = 1,

    },

    };

    static int uvc_probe(struct usb_interface *intf,const struct usb_device_id *id){

    ......

    uvc_register_chains(dev);

    ......

    }

    static int uvc_register_chains(struct uvc_device *dev){

    ......

    ret = uvc_register_terms(dev, chain);

    ......

    }

    static int uvc_register_terms(struct uvc_device *dev,struct uvc_video_chain *chain){

    ......

    ret = uvc_register_video(dev, stream);

    ......

    }

    static int uvc_register_video(struct uvc_device *dev,struct uvc_streaming *stream){

    ......

    vdev = video_device_alloc();

    ......

    vdev->v4l2_dev = &dev->vdev;

    vdev->fops = &uvc_fops;

    vdev->release = uvc_release;

    ......

    ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);

    ......

    }

    3.drivers/media/video/uvc/uvc_v4l2.c

    const struct v4l2_file_operations uvc_fops = {

    .owner = THIS_MODULE,

    .open = uvc_v4l2_open,

    .release = uvc_v4l2_release,

    .unlocked_ioctl = uvc_v4l2_ioctl,

    .read = uvc_v4l2_read,

    .mmap = uvc_v4l2_mmap,

    .poll = uvc_v4l2_poll,

    #ifndef CONFIG_MMU

    .get_unmapped_area = uvc_v4l2_get_unmapped_area,

    #endif

    };

    static long uvc_v4l2_ioctl(struct file *file,unsigned int cmd, unsigned long arg){

    ......

    return video_usercopy(file, cmd, arg, uvc_v4l2_do_ioctl);

    }

    static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg){

    ......

    switch (cmd) {

    case VIDIOC_QUERYCAP:......

    case VIDIOC_QUERYCTRL:

    case VIDIOC_G_CTRL:

    case VIDIOC_S_CTRL:

    case VIDIOC_QUERYMENU:

    case VIDIOC_G_EXT_CTRLS:

    case VIDIOC_S_EXT_CTRLS:

    case VIDIOC_TRY_EXT_CTRLS:

    case VIDIOC_ENUMINPUT:

    case VIDIOC_G_INPUT:

    case VIDIOC_S_INPUT:

    case VIDIOC_ENUM_FMT:

    case VIDIOC_TRY_FMT:

    case VIDIOC_S_FMT:

    case VIDIOC_G_FMT:

    case VIDIOC_ENUM_FRAMESIZES:

    case VIDIOC_ENUM_FRAMEINTERVALS:

    case VIDIOC_G_PARM:

    case VIDIOC_S_PARM:

    case VIDIOC_CROPCAP:

    case VIDIOC_G_CROP:

    case VIDIOC_S_CROP:

    case VIDIOC_REQBUFS:

    case VIDIOC_QUERYBUF:

    case VIDIOC_QBUF:

    case VIDIOC_DQBUF:

    case VIDIOC_STREAMON:

    case VIDIOC_STREAMOFF:

    case VIDIOC_ENUMSTD:

    case VIDIOC_QUERYSTD:

    case VIDIOC_G_STD:

    case VIDIOC_S_STD:

    case VIDIOC_OVERLAY:

    case VIDIOC_ENUMAUDIO:

    case VIDIOC_ENUMAUDOUT:

    case VIDIOC_ENUMOUTPUT:

    case __UVCIOC_CTRL_ADD:

    case __UVCIOC_CTRL_MAP_OLD:

    case __UVCIOC_CTRL_MAP:

    case UVCIOC_CTRL_MAP:

    case __UVCIOC_CTRL_GET:

    case __UVCIOC_CTRL_SET:

    case UVCIOC_CTRL_QUERY:

    ......

    }

    ......

    }

    展开全文
  • 本文基于AM6C平台Linux...1.drivers/media/video/uvc/Makefileuvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \uvc_status.o uvc_isight.oobj-$(CONFIG_USB_VIDEO_CLASS) += uvcvide...

    本文基于AM6C平台Linux3.0.8内核。

    1.drivers/media/video/uvc/Makefile

    uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \

    uvc_status.o uvc_isight.o

    obj-$(CONFIG_USB_VIDEO_CLASS) += uvcvideo.o

    2.drivers/media/video/uvc/uvc_driver.c

    module_init(uvc_init);

    static int __init uvc_init(void){

    ......

    result = usb_register(&uvc_driver.driver);

    ......

    }

    struct uvc_driver uvc_driver = {

    .driver = {

    .name = "uvcvideo",

    .probe = uvc_probe,

    .disconnect = uvc_disconnect,

    .suspend = uvc_suspend,

    .resume = uvc_resume,

    .reset_resume = uvc_reset_resume,

    .id_table = uvc_ids,

    .supports_autosuspend = 1,

    },

    };

    static int uvc_probe(struct usb_interface *intf,const struct usb_device_id *id){

    ......

    uvc_register_chains(dev);

    ......

    }

    static int uvc_register_chains(struct uvc_device *dev){

    ......

    ret = uvc_register_terms(dev, chain);

    ......

    }

    static int uvc_register_terms(struct uvc_device *dev,struct uvc_video_chain *chain){

    ......

    ret = uvc_register_video(dev, stream);

    ......

    }

    static int uvc_register_video(struct uvc_device *dev,struct uvc_streaming *stream){

    ......

    vdev = video_device_alloc();

    ......

    vdev->v4l2_dev = &dev->vdev;

    vdev->fops = &uvc_fops;

    vdev->release = uvc_release;

    ......

    ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);

    ......

    }

    3.drivers/media/video/uvc/uvc_v4l2.c

    const struct v4l2_file_operations uvc_fops = {

    .owner = THIS_MODULE,

    .open = uvc_v4l2_open,

    .release = uvc_v4l2_release,

    .unlocked_ioctl = uvc_v4l2_ioctl,

    .read = uvc_v4l2_read,

    .mmap = uvc_v4l2_mmap,

    .poll = uvc_v4l2_poll,

    #ifndef CONFIG_MMU

    .get_unmapped_area = uvc_v4l2_get_unmapped_area,

    #endif

    };

    static long uvc_v4l2_ioctl(struct file *file,unsigned int cmd, unsigned long arg){

    ......

    return video_usercopy(file, cmd, arg, uvc_v4l2_do_ioctl);

    }

    static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg){

    ......

    switch (cmd) {

    case VIDIOC_QUERYCAP:......

    case VIDIOC_QUERYCTRL:

    case VIDIOC_G_CTRL:

    case VIDIOC_S_CTRL:

    case VIDIOC_QUERYMENU:

    case VIDIOC_G_EXT_CTRLS:

    case VIDIOC_S_EXT_CTRLS:

    case VIDIOC_TRY_EXT_CTRLS:

    case VIDIOC_ENUMINPUT:

    case VIDIOC_G_INPUT:

    case VIDIOC_S_INPUT:

    case VIDIOC_ENUM_FMT:

    case VIDIOC_TRY_FMT:

    case VIDIOC_S_FMT:

    case VIDIOC_G_FMT:

    case VIDIOC_ENUM_FRAMESIZES:

    case VIDIOC_ENUM_FRAMEINTERVALS:

    case VIDIOC_G_PARM:

    case VIDIOC_S_PARM:

    case VIDIOC_CROPCAP:

    case VIDIOC_G_CROP:

    case VIDIOC_S_CROP:

    case VIDIOC_REQBUFS:

    case VIDIOC_QUERYBUF:

    case VIDIOC_QBUF:

    case VIDIOC_DQBUF:

    case VIDIOC_STREAMON:

    case VIDIOC_STREAMOFF:

    case VIDIOC_ENUMSTD:

    case VIDIOC_QUERYSTD:

    case VIDIOC_G_STD:

    case VIDIOC_S_STD:

    case VIDIOC_OVERLAY:

    case VIDIOC_ENUMAUDIO:

    case VIDIOC_ENUMAUDOUT:

    case VIDIOC_ENUMOUTPUT:

    case __UVCIOC_CTRL_ADD:

    case __UVCIOC_CTRL_MAP_OLD:

    case __UVCIOC_CTRL_MAP:

    case UVCIOC_CTRL_MAP:

    case __UVCIOC_CTRL_GET:

    case __UVCIOC_CTRL_SET:

    case UVCIOC_CTRL_QUERY:

    ......

    }

    ......

    }

    展开全文
  • Linux uvc 摄像头驱动

    2010-09-03 15:53:03
    这是一个Linux内核的摄像头驱动程序,是大家学习些驱动的好例子。。网上好多编译不过的。此驱动ubuntu下编译通过的
  • mini2440 Linux UVC摄像头采集视频

    热门讨论 2012-11-15 21:27:39
    在mini2440 Linux平台下使用UVC摄像头采集视频,此程序可以让初学者了解视频采集过程
  • Linux uvc驱动分析

    千次阅读 2013-06-28 16:59:37
    1.common/drivers/media/video/uvc/uvc_driver.c module_init(uvc_init); static int __init uvc_init(void){ result = usb_register(&uvc_driver.driver); } struct uvc_driver uvc_driver = {
  • linux UVC摄像头驱动 简介

    万次阅读 2013-02-25 15:55:41
     Linux UVC driver(uvc) 该驱动适用于符合USB视频类(USB Video Class)规范的摄像头设备,它包括V4L2内核设备驱动和用户空间工具补丁。大多数大容量存储器设备(如优盘)都遵循USB规范,因而仅用一个单一驱动就可以...
  • linux uvc的用法

    2017-09-26 18:23:27
    最近看了好几天uvc相关的东西,包括USB框架,USB GADGET,V4L2,但是到现在还没搞清楚UVC是怎么个用法?我就是想把带摄像头的开发板 作为一个device端 ,求助啊 ,给点提示,感觉乱糟糟的。。。
  • Linux_UVC_Camera:linux系统下的UVC摄像头编程
  • Linux uvc摄像头驱动初探

    千次阅读 2013-08-20 15:26:39
    1.drivers/media/video/uvc/Makefile uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \ uvc_status.o uvc_isight.o obj-$(CONFIG_USB_VIDEO_CLASS) += uvcvideo.o 2.dr
  • linux uvc camera driver

    2015-05-12 15:21:44
  • Linux UVC 摄像头知识整理之USB概述

    千次阅读 2017-10-09 11:15:41
    Linux UVC摄像头驱动流程 最近在学习USB摄像头,所谓好记性不如烂笔头,现在将自己所学的东西整理一下。 学习USB摄像头之前,先整理下USB有关概念。 1. USB 有关知识 USB通信采用主从结构,实现主机控制器和外围...
  • 现在,假如你的手上有一只摄像头,它是罗技高清网络摄像头webcam-C270,还有一块cortexA8开发板,这块开发板来自FriendlyARM,已经预装了linux系统,版本号是最新提供的linux-3.0.8,图形界面是Qtopia-2.2.0,交
  • linux uvc usb camera driver

    2015-05-12 20:21:15
    usb被插入后识别为video3,所以应用中将打开设备由/dev/video0改为/dev/video3.
  • 分为板子运行程序(c语言),pc机运行程序(Qt),完成了板子lcd显示并通过ethernet传输到电脑上然后再显示出来。 上位机通过qt编写 jz2440 摄像头为支持uvc的mjpeg输出格式的摄像头。
  • Linux UVC driver 独立交叉编译记录

    千次阅读 2016-09-06 10:38:59
    官网介绍如下: Typical usage is:git clone git://linuxtv.org/... 这个是针对你当前运行的linux环境的编译。下面介绍下如何针对指定的内核版本进行交叉编译。 1 下载项目源码:git clone git://linuxtv.org/media_b
  • linuxuvc驱动

    热门讨论 2011-12-27 15:42:25
    linux系统下usb摄像头驱动程序,支持v4l/v4l2,代码简洁明了
  • linux uvc 深入理解(一)

    2017-06-16 16:22:00
    Linux UVC driver(uvc) 该驱动适用于符合USB视频类(USB Video Class)规范的摄像头设备,它包括V4L2内核设备驱动和用户空间工具补丁。只要符合这类标准,则不同厂商的USB camera设备,不需要特定的driver就能在Linux...
  • linux uvc深入理解(三)

    2017-06-16 16:31:00
    上一篇讲到usb_register将uvc_driver.driver注册进去,今天我们来梳理下uvc_driver.driver中最重要的函数probe(即uvc_probe)。 uvc_probe会传入2组参数,分别是struct usb_interface *intf和const struct usb_...
  • linux uvc深入理解(二)

    2017-06-16 16:26:00
    这个结构体注册到usb驱动中,其中uvc_ids就是usb的过滤器,只有将支持uvc camera的VID和PID填入这个结构体,usb驱动才会在识别到camera后将其分发给uvc驱动,当然在uvc_ids中最后有这么个赋值: /* Generic USB ...
  • linux uvc深入理解( 四)

    2017-06-16 16:33:00
    上文把uvc驱动的初始化部分分析的差不多了,从现在起我们开始着手uvc的操作流程,先给出我自己写的一个调用v4l2接口的应用,方便之后的分析 int main() { int ret; int camera_fd; //打开uvc设备,获取设备句柄 ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,844
精华内容 1,137
关键字:

linuxuvc版本

linux 订阅