当前位置: 首页 > article >正文

---usb 摄像头的Linux 下查询的命令

 0)  先 列一下机子上所插的摄像头:

 ~$  v4l2-ctl --list-devices

iContact Camera Pro: iContact C (usb-0000:00:14.0-2):
    /dev/video3
    /dev/video4
    /dev/media1

USB 2.0 PC Camera: PC Camera (usb-0000:00:14.0-8):
    /dev/video1
    /dev/video2
    /dev/media0


1)   简单地列一列支持的像素格式
          $ v4l2-ctl --list-formats -d /dev/video0

          ioctl: VIDIOC_ENUM_FMT
          Type: Video Capture

           [0]: 'MJPG' (Motion-JPEG, compressed)
           [1]: 'YUYV' (YUYV 4:2:2)

         $ v4l2-ctl  --list-formats-ext   -d /dev/video0 
            (详尽:  分辨率/刷新率)

ioctl: VIDIOC_ENUM_FMT
    Type: Video Capture

    [0]: 'MJPG' (Motion-JPEG, compressed)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1280x960
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 800x600
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1280x720
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
    [1]: 'YUYV' (YUYV 4:2:2)
        Size: Discrete 640x480
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1280x960
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 800x600
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 352x288
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 320x240
            Interval: Discrete 0.033s (30.000 fps)
            Interval: Discrete 0.040s (25.000 fps)
            Interval: Discrete 0.050s (20.000 fps)
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 176x144
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 160x120
            Interval: Discrete 0.067s (15.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)
        Size: Discrete 1280x720
            Interval: Discrete 0.083s (12.000 fps)
            Interval: Discrete 0.100s (10.000 fps)
            Interval: Discrete 0.200s (5.000 fps)

2)   驱动信息和  控制项

   Driver infos:

       Driver Info/Media Driver info/Interface Info/Entity Info/
      Priority/Video Input/
     Format Video Capture:/
     Cropped Capability Video Capture
     Selection Video Capture
    Streaming Video Capture

    Controls: 
            (Camera side + User side):
         

  $ v4l2-ctl --all  -d /dev/video0

Driver Info:
    Driver name      : uvcvideo
    Card type        : USB 2.0 PC Camera: PC Camera
    Bus info         : usb-0000:00:14.0-8
    Driver version   : 6.8.12
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Media Driver Info:
    Driver name      : uvcvideo
    Model            : USB 2.0 PC Camera: PC Camera
    Serial           :
    Bus info         : usb-0000:00:14.0-8
    Media version    : 6.8.12
    Hardware revision: 0x00000001 (1)
    Driver version   : 6.8.12
Interface Info:
    ID               : 0x03000002
    Type             : V4L Video
Entity Info:
    ID               : 0x00000001 (1)
    Name             : USB 2.0 PC Camera: PC Camera
    Function         : V4L2 I/O
    Flags            : default
    Pad 0x01000007   : 0: Sink
      Link 0x02000010: from remote pad 0x100000a of entity 'Processing 2' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 640/480
    Pixel Format      : 'MJPG' (Motion-JPEG)
    Field             : None
    Bytes per Line    : 0
    Size Image        : 921600
    Colorspace        : sRGB
    Transfer Function : Rec. 709
    YCbCr/HSV Encoding: ITU-R 601
    Quantization      : Default (maps to Full Range)
    Flags             :
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 640, Height 480
    Default     : Left 0, Top 0, Width 640, Height 480
    Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags:


  下面红色的视频流参数: fps:  #也可以通过 v4l2-ctl -d /dev/video1  --get-parm命令获取

Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 30.000 (30/1)
    Read buffers     : 0

User Controls

                     brightness 0x00980900 (int)    : min=-255 max=255 step=1 default=0 value=0
                       contrast 0x00980901 (int)    : min=0 max=30 step=1 default=15 value=15
                     saturation 0x00980902 (int)    : min=0 max=127 step=1 default=32 value=32
                            hue 0x00980903 (int)    : min=-16000 max=16000 step=1 default=0 value=0
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1
                          gamma 0x00980910 (int)    : min=20 max=250 step=10 default=100 value=100
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1 (50 Hz)
                0: Disabled
                1: 50 Hz
                2: 60 Hz
      white_balance_temperature 0x0098091a (int)    : min=2500 max=7000 step=1 default=5000 value=5000 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=3 step=1 default=1 value=1
         backlight_compensation 0x0098091c (int)    : min=0 max=2 step=1 default=1 value=1

Camera Controls

                  auto_exposure 0x009a0901 (menu)   : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
                1: Manual Mode
                3: Aperture Priority Mode
         exposure_time_absolute 0x009a0902 (int)    : min=2 max=5000 step=1 default=312 value=312 flags=inactive
     exposure_dynamic_framerate 0x009a0903 (bool)   : default=0 value=1


3)列出指定像素格式下的分辨率:
           v4l2-ctl --verbose --list-framesizes=MJPG -d /dev/video0
 

4)   设定分辨率和像素格式
     v4l2-ctl -d /dev/video1 --set-fmt-video=width=1280,height=960,pixelformat=MJPG

     #verified it
    v4l2-ctl -d /dev/video1   --get-fmt-video


http://www.kler.cn/a/400936.html

相关文章:

  • java基础知识全集(一篇看到爽)(持续更新中)
  • 十五届蓝桥杯赛题-c/c++ 大学b组
  • 【售前方案】工业园区整体解决方案,智慧园区方案,智慧城市方案,智慧各类信息化方案(ppt原件)
  • 一些常见网络安全术语
  • 前端:HTML (学习笔记)【1】
  • nuget 管理全局包、缓存和临时文件夹
  • Go语言教程(一看就会)
  • 高级java每日一道面试题-2024年11月08日-RabbitMQ篇-RabbitMQ有哪些重要的角色?有哪些重要的组件?
  • 用AI来写SQL:让ChatGPT成为你的数据库助手
  • Spring Boot汽车资讯:科技与汽车的新融合
  • Spring Boot开箱即用可插拔实现过程演练与原理剖析
  • 【golang-技巧】-线上死锁问题排查-by pprof
  • React Native 全栈开发实战班 - 原生功能集成之权限管理
  • Qt 和 WPF(Windows Presentation Foundation)
  • 交易效率不打打折扣,遵循昂首平台优化策略
  • SLAM-evo 评估
  • webpack案例----pdd(anti-content)
  • 算法--“汽车加油”问题.
  • 如何解决JAVA程序通过obloader并发导数导致系统夯住的问题 | OceanBase 运维实践
  • sql专场练习(二)(16-20)完结
  • 目前区块链服务商备案支持的区块链技术类型
  • SpringBoot整合ELK使用详解
  • 【大语言模型】ACL2024论文-12 大型语言模型的能力如何受到监督式微调数据组成影响
  • Cookie 与 Session:差异剖析与应用实战
  • js实现导航栏鼠标移入时,下划线跟随鼠标滑动
  • 机器学习 线性回归 学习笔记