UVC摄像头 描述
UVC
市面上 UVC摄像头很多,本文通过win10自带的工具 ,分析摄像头能力。同时通过抓包实现基本调试。
usbview.exe (window debug 神器)
参照 https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview
安装驱动,同时安装VS 时 选择安装 Windows 开发kits 。就能在kits中找到
Windows Kits\10\Debuggers\x64
UVC SPEC
UVC 拓扑图
UVC 描述符层次图
UVC view获取的信息
根据上述的拓扑图 和层次图,USBview能获取对应的信息
设备描述符
设备描述符和USB设备描述符的数据格式一致,各字段的解释详见USB设备描述符。
配置描述符
配置描述符包含的信息比较多,包括配置描述符本身,也包括关联接口描述符,接口描述符,端点描述符和UVC定义的其它描述符如输入端点描述符等。
第一个当然是配置描述符:
UVC的接口关联描述符(Interface Association Descriptor )
控制接口描述符
为标准的描述符,后跟类特定视频控制接口头描述符.
Class-Specific 视频控制接口头描述符
其他描述符 也可以一一对应。
视频流输入头描述符
MJPEG
===>Video Streaming MJPEG Format Type Descriptor<===
bLength: 0x0B
bDescriptorType: 0x24
bDescriptorSubtype: 0x06
bFormatIndex: 0x01
bNumFrameDescriptors: 0x06
bmFlags: 0x01 -> Sample Size is Fixed
bDefaultFrameIndex: 0x01
bAspectRatioX: 0x00
bAspectRatioY: 0x00
bmInterlaceFlags: 0x00
D00 = 0 non-Interlaced stream or variable
D01 = 0 2 fields per frame
D02 = 0 Field 1 not first
D03 = 0 Reserved
D4..5 = 0 Field patterns -> Field 1 only
D6..7 = 0 Display Mode -> Bob only
bCopyProtect: 0x00 -> Duplication Unrestricted
*!*ERROR: no Color Matching Descriptor for this format
===>Video Streaming MJPEG Frame Type Descriptor<===
--->This is the Default (optimum) Frame index
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x01
bmCapabilities: 0x00
wWidth: 0x0A00 = 2560
wHeight: 0x05A0 = 1440
dwMinBitRate: 0x69780000
dwMaxBitRate: 0x69780000
dwMaxVideoFrameBufferSize: 0x00708000
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
===>Video Streaming MJPEG Frame Type Descriptor<===
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x02
bmCapabilities: 0x00
wWidth: 0x0900 = 2304
wHeight: 0x0510 = 1296
dwMinBitRate: 0x556E0000
dwMaxBitRate: 0x556E0000
dwMaxVideoFrameBufferSize: 0x005B2000
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
===>Video Streaming MJPEG Frame Type Descriptor<===
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x03
bmCapabilities: 0x00
wWidth: 0x0780 = 1920
wHeight: 0x0438 = 1080
dwMinBitRate: 0x3B538000
dwMaxBitRate: 0x3B538000
dwMaxVideoFrameBufferSize: 0x003F4800
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
===>Video Streaming MJPEG Frame Type Descriptor<===
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x04
bmCapabilities: 0x00
wWidth: 0x0500 = 1280
wHeight: 0x02D0 = 720
dwMinBitRate: 0x1A5E0000
dwMaxBitRate: 0x1A5E0000
dwMaxVideoFrameBufferSize: 0x001C2000
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
===>Video Streaming MJPEG Frame Type Descriptor<===
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x05
bmCapabilities: 0x00
wWidth: 0x0280 = 640
wHeight: 0x01E0 = 480
dwMinBitRate: 0x08CA0000
dwMaxBitRate: 0x08CA0000
dwMaxVideoFrameBufferSize: 0x00096000
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
===>Video Streaming MJPEG Frame Type Descriptor<===
bLength: 0x1E
bDescriptorType: 0x24
bDescriptorSubtype: 0x07
bFrameIndex: 0x06
bmCapabilities: 0x00
wWidth: 0x0280 = 640
wHeight: 0x0168 = 360
dwMinBitRate: 0x06978000
dwMaxBitRate: 0x06978000
dwMaxVideoFrameBufferSize: 0x00070800
dwDefaultFrameInterval: 0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType: 0x01
===>Additional Discrete Frame TypeData
dwFrameInterval[1]: 0x00051615 = 33.333300 mSec (30.00 Hz)
可以明显看到 设备支持MJPEG
bFormatIndex | bFrameIndex | width X height |
---|---|---|
1 | 1 | 2560 X 1440 |
1 | 2 | 2304 X 1296 |
1 | 3 | 1920 X 1080 |
1 | 4 | 1280 X 720 |
1 | 5 | 640 X 480 |
1 | 6 | 640X 360 |