UVC摄像头技术笔记
+ -

UVC Windows下UVC摄像头数据分析

2020-10-23 4933 0

这里我们分析一款UVC摄像头来进行数据分析。

  • 环境:win10 x64
  • 工具:bushound,usbviewer

将摄像头插入PC后,打开usbviewer工具,可以看到关于此摄像头的相关信息。
可以看到,这个摄像头其实是一个USB复合设备,所以其对应的系统驱动为USBCCGP,然后再由USB复合设备驱动枚举出2个设备,一个为摄像头(UVC设备),一个为音频输入设备(UAV设备)。
1603165888192

描述符分析

由于USBViewer这个工具是按USB端口来显示设备信息的,所以这里显示的是复合设备的信息,当然这里也包括摄像头和音频输入设备。这里我们只分析UVC摄像头的描述符。
USBViewer

设备描述符

设备描述符和USB设备描述符的数据格式一致,各字段的解释详见USB设备描述符。

          ===>Device Descriptor<===
bLength:                           0x12
bDescriptorType:                   0x01
bcdUSB:                          0x0200
bDeviceClass:                      0xEF  -> This is a Multi-interface Function Code Device
bDeviceSubClass:                   0x02  -> This is the Common Class Sub Class
bDeviceProtocol:                   0x01  -> This is the Interface Association Descriptor protocol
bMaxPacketSize0:                   0x40 = (64) Bytes
idVendor:                        0x1D6B = The Linux Foundation
idProduct:                       0x0102
bcdDevice:                       0x0409
iManufacturer:                     0x01
     English (United States)  "Linux Foundation"
iProduct:                          0x02
     English (United States)  "USB Webcam gadget"
iSerialNumber:                     0x00
bNumConfigurations:                0x01

配置描述符

配置描述符包含的信息比较多,包括配置描述符本身,也包括关联接口描述符,接口描述符,端点描述符和UVC定义的其它描述符如输入端点描述符等。

第一个当然是配置描述符:

          ===>Configuration Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x02
wTotalLength:                    0x032B  -> Validated
bNumInterfaces:                    0x04
bConfigurationValue:               0x01
iConfiguration:                    0x04
     English (United States)  "Video"
bmAttributes:                      0xC0  -> Self Powered
MaxPower:                          0x01 =   2 mA

UVC的接口关联描述符

          ===>IAD Descriptor<===
bLength:                           0x08
bDescriptorType:                   0x0B
bFirstInterface:                   0x00
bInterfaceCount:                   0x02
bFunctionClass:                    0x0E  -> Video Interface Class
bFunctionSubClass:                 0x03  -> Video Interface Collection
bFunctionProtocol:                 0x00  -> PC_PROTOCOL_UNDEFINED protocol
iFunction:                         0x05
     English (United States)  "UVC HD Camera"
控制接口描述符,为标准的描述符,后跟类特定视频控制接口头描述符.
          ===>Interface Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x04
bInterfaceNumber:                  0x00
bAlternateSetting:                 0x00
bNumEndpoints:                     0x01
bInterfaceClass:                   0x0E  -> Video Interface Class
bInterfaceSubClass:                0x01  -> Video Control Interface SubClass
bInterfaceProtocol:                0x00
iInterface:                        0x05
     English (United States)  "UVC HD Camera"

类特定视频控制接口头描述符:

          ===>Class-Specific Video Control Interface Header Descriptor<===
bLength:                           0x0D
bDescriptorType:                   0x24
bDescriptorSubtype:                0x01
bcdVDC:                          0x0100
wTotalLength:                    0x0069  -> Validated
dwClockFreq:                 0x02DC6C00 = (48000000) Hz
bInCollection:                     0x01
baInterfaceNr[1]:                  0x01
USB Video Class device: spec version 1.0

输入端点描述符

          ===>Video Control Input Terminal Descriptor<===
bLength:                           0x12
bDescriptorType:                   0x24
bDescriptorSubtype:                0x02
bTerminalID:                       0x01
wTerminalType:                   0x0201 = (ITT_CAMERA)
bAssocTerminal:                    0x00
iTerminal:                         0x00
===>Camera Input Terminal Data
wObjectiveFocalLengthMin:        0x0000
wObjectiveFocalLengthMax:        0x0000
wOcularFocalLength:              0x0000
bControlSize:                      0x03
bmControls : 0x02 0x00 0x00 
     D00 = 0   no -  Scanning Mode
     D01 = 1  yes -  Auto-Exposure Mode
     D02 = 0   no -  Auto-Exposure Priority
     D03 = 0   no -  Exposure Time (Absolute)
     D04 = 0   no -  Exposure Time (Relative)
     D05 = 0   no -  Focus (Absolute)
     D06 = 0   no -  Focus (Relative)
     D07 = 0   no -  Iris (Absolute)
     D08 = 0   no -  Iris (Relative)
     D09 = 0   no -  Zoom (Absolute)
     D10 = 0   no -  Zoom (Relative)
     D11 = 0   no -  PanTilt (Absolute)
     D12 = 0   no -  PanTilt (Relative)
     D13 = 0   no -  Roll (Absolute)
     D14 = 0   no -  Roll (Relative)
     D15 = 0   no -  Reserved
     D16 = 0   no -  Reserved
     D17 = 0   no -  Focus, Auto
     D18 = 0   no -  Privacy
     D19 = 0   no -  Focus, Simple
     D20 = 0   no -  Window
     D21 = 0   no -  Region of Interest
     D22 = 0   no -  Reserved
     D23 = 0   no -  Reserved

处理单元描述符

          ===>Video Control Processing Unit Descriptor<===
bLength:                           0x0B
bDescriptorType:                   0x24
bDescriptorSubtype:                0x05
bUnitID:                           0x04
bSourceID:                         0x01
wMaxMultiplier:                  0x4000
bControlSize:                      0x02
bmControls : 0x1F 0x04 
     D00 = 1  yes -  Brightness
     D01 = 1  yes -  Contrast
     D02 = 1  yes -  Hue
     D03 = 1  yes -  Saturation
     D04 = 1  yes -  Sharpness
     D05 = 0   no -  Gamma
     D06 = 0   no -  White Balance Temperature
     D07 = 0   no -  White Balance Component
     D08 = 0   no -  Backlight Compensation
     D09 = 0   no -  Gain
     D10 = 1  yes -  Power Line Frequency
     D11 = 0   no -  Hue, Auto
     D12 = 0   no -  White Balance Temperature, Auto
     D13 = 0   no -  White Balance Component, Auto
     D14 = 0   no -  Digital Multiplier
     D15 = 0   no -  Digital Multiplier Limit
iProcessing :                      0x00

扩展单元描述符:

          ===>Video Control Extension Unit Descriptor<===
bLength:                           0x1B
bDescriptorType:                   0x24
bDescriptorSubtype:                0x06
bUnitID:                           0x06
guidExtensionCode:                 {23E49ED0-1178-4F31-AE52-D2FB8A8D3B48}
bNumControls:                      0x0E
bNrInPins:                         0x01
===>List of Connected Units and Terminal ID's
baSourceID[1]:                     0x04
bControlSize:                      0x02
bmControls : 0xFF 0x6F 
     D00 = 1  yes -  Vendor-Specific (Optional)
     D01 = 1  yes -  Vendor-Specific (Optional)
     D02 = 1  yes -  Vendor-Specific (Optional)
     D03 = 1  yes -  Vendor-Specific (Optional)
     D04 = 1  yes -  Vendor-Specific (Optional)
     D05 = 1  yes -  Vendor-Specific (Optional)
     D06 = 1  yes -  Vendor-Specific (Optional)
     D07 = 1  yes -  Vendor-Specific (Optional)
     D08 = 1  yes -  Vendor-Specific (Optional)
     D09 = 1  yes -  Vendor-Specific (Optional)
     D10 = 1  yes -  Vendor-Specific (Optional)
     D11 = 1  yes -  Vendor-Specific (Optional)
     D12 = 0   no -  Vendor-Specific (Optional)
     D13 = 1  yes -  Vendor-Specific (Optional)
     D14 = 1  yes -  Vendor-Specific (Optional)
     D15 = 0   no -  Vendor-Specific (Optional)
iExtension:                        0x00

第二个扩展单元描述符:


          ===>Video Control Extension Unit Descriptor<===
bLength:                           0x1B
bDescriptorType:                   0x24
bDescriptorSubtype:                0x06
bUnitID:                           0x02
guidExtensionCode:                 {2C49D16A-32B8-4485-3EA8-643A152362F2}
bNumControls:                      0x06
bNrInPins:                         0x01
===>List of Connected Units and Terminal ID's
baSourceID[1]:                     0x06
bControlSize:                      0x02
bmControls : 0x3F 0x00 
     D00 = 1  yes -  Vendor-Specific (Optional)
     D01 = 1  yes -  Vendor-Specific (Optional)
     D02 = 1  yes -  Vendor-Specific (Optional)
     D03 = 1  yes -  Vendor-Specific (Optional)
     D04 = 1  yes -  Vendor-Specific (Optional)
     D05 = 1  yes -  Vendor-Specific (Optional)
     D06 = 0   no -  Vendor-Specific (Optional)
     D07 = 0   no -  Vendor-Specific (Optional)
     D08 = 0   no -  Vendor-Specific (Optional)
     D09 = 0   no -  Vendor-Specific (Optional)
     D10 = 0   no -  Vendor-Specific (Optional)
     D11 = 0   no -  Vendor-Specific (Optional)
     D12 = 0   no -  Vendor-Specific (Optional)
     D13 = 0   no -  Vendor-Specific (Optional)
     D14 = 0   no -  Vendor-Specific (Optional)
     D15 = 0   no -  Vendor-Specific (Optional)
iExtension:                        0x00

输出端点描述符:

          ===>Video Control Output Terminal Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x24
bDescriptorSubtype:                0x03
bTerminalID:                       0x03
wTerminalType:                   0x0101 = (TT_STREAMING)
bAssocTerminal:                    0x00
bSourceID:                         0x02
iTerminal:                         0x00

用于中断返回的状返回端点描述符:


          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x83  -> Direction: IN - EndpointID: 3
bmAttributes:                      0x03  -> Interrupt Transfer Type
wMaxPacketSize:                  0x0010 = 1 transactions per microframe, 0x10 max bytes
bInterval:                         0x08

          ===>Class-specific VC Interrupt Endpoint Descriptor<===
bLength:                           0x05 
bDescriptorType:                   0x25
bDescriptorSubtype:                0x03
wMaxTransferSize:                0x0010 = (16) Bytes
`
视频流接口描述符
    ===>Interface Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x04
bInterfaceNumber:                  0x01
bAlternateSetting:                 0x00
bNumEndpoints:                     0x00
bInterfaceClass:                   0x0E  -> Video Interface Class
bInterfaceSubClass:                0x02  -> Video Streaming Interface SubClass
bInterfaceProtocol:                0x00
iInterface:                        0x06
     English (United States)  "Video Streaming"

视频流输入头描述符

          ===>Video Class-Specific VS Video Input Header Descriptor<===
bLength:                           0x11
bDescriptorType:                   0x24
bDescriptorSubtype:                0x01
bNumFormats:                       0x04
wTotalLength:                    0x0217  -> Validated
bEndpointAddress:                  0x81  -> Direction: IN - EndpointID: 1
bmInfo:                            0x00  -> Dynamic Format Change not Supported
bTerminalLink:                     0x03
bStillCaptureMethod:               0x00  -> No Still Capture
bTriggerSupport:                   0x00  -> No Hardware Triggering Support
bTriggerUsage:                     0x00
bControlSize:                      0x01
Video Payload Format 1             0x00 
     D00 = 0   no -  Key Frame Rate
     D01 = 0   no -  P Frame Rate
     D02 = 0   no -  Compression Quality
     D03 = 0   no -  Compression Window Size
     D04 = 0   no -  Generate Key Frame
     D05 = 0   no -  Update Frame Segment
     D06 = 0   no -  Reserved
     D07 = 0   no -  Reserved
Video Payload Format 2             0x00 
     D00 = 0   no -  Key Frame Rate
     D01 = 0   no -  P Frame Rate
     D02 = 0   no -  Compression Quality
     D03 = 0   no -  Compression Window Size
     D04 = 0   no -  Generate Key Frame
     D05 = 0   no -  Update Frame Segment
     D06 = 0   no -  Reserved
     D07 = 0   no -  Reserved
Video Payload Format 3             0x04 
     D00 = 0   no -  Key Frame Rate
     D01 = 0   no -  P Frame Rate
     D02 = 1  yes -  Compression Quality
     D03 = 0   no -  Compression Window Size
     D04 = 0   no -  Generate Key Frame
     D05 = 0   no -  Update Frame Segment
     D06 = 0   no -  Reserved
     D07 = 0   no -  Reserved
Video Payload Format 4             0x04 
     D00 = 0   no -  Key Frame Rate
     D01 = 0   no -  P Frame Rate
     D02 = 1  yes -  Compression Quality
     D03 = 0   no -  Compression Window Size
     D04 = 0   no -  Generate Key Frame
     D05 = 0   no -  Update Frame Segment
     D06 = 0   no -  Reserved
     D07 = 0   no -  Reserved

支持的三种分辩率的MJPG数据格式和帧格式描述符:

bFormatIndex bFrameIndex 分辩率及及帧率
1 1 640x480x(30,15,10)
1 2 1280x720x(30,15,10)
1 3 1920x1080x(30,15,10)
 ===>Video Streaming MJPEG Format Type Descriptor<===
bLength:                           0x0B
bDescriptorType:                   0x24
bDescriptorSubtype:                0x06
bFormatIndex:                      0x01
bNumFrameDescriptors:              0x03
bmFlags:                           0x00  -> Sample Size is Not Fixed
bDefaultFrameIndex:                0x03
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

          ===>Video Streaming MJPEG Frame Type Descriptor<===
bLength:                           0x26
bDescriptorType:                   0x24
bDescriptorSubtype:                0x07
bFrameIndex:                       0x01
bmCapabilities:                    0x00
wWidth:                          0x0280 = 640
wHeight:                         0x01E0 = 480
dwMinBitRate:                0x02EE0000
dwMaxBitRate:                0x08CA0000
dwMaxVideoFrameBufferSize:   0x00096000
dwDefaultFrameInterval:      0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType:                0x03
===>Additional Discrete Frame TypeData
dwFrameInterval[1]:          0x00051615 = 33.333300 mSec (30.00 Hz)
dwFrameInterval[2]:          0x000A2C2A = 66.666600 mSec (15.00 Hz)
dwFrameInterval[3]:          0x000F4240 = 100.000000 mSec (10.00 Hz)

          ===>Video Streaming MJPEG Frame Type Descriptor<===
bLength:                           0x26
bDescriptorType:                   0x24
bDescriptorSubtype:                0x07
bFrameIndex:                       0x02
bmCapabilities:                    0x00
wWidth:                          0x0500 = 1280
wHeight:                         0x02D0 = 720
dwMinBitRate:                0x08CA0000
dwMaxBitRate:                0x1A5E0000
dwMaxVideoFrameBufferSize:   0x001C2000
dwDefaultFrameInterval:      0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType:                0x03
===>Additional Discrete Frame TypeData
dwFrameInterval[1]:          0x00051615 = 33.333300 mSec (30.00 Hz)
dwFrameInterval[2]:          0x000A2C2A = 66.666600 mSec (15.00 Hz)
dwFrameInterval[3]:          0x000F4240 = 100.000000 mSec (10.00 Hz)

          ===>Video Streaming MJPEG Frame Type Descriptor<===
          --->This is the Default (optimum) Frame index
bLength:                           0x26
bDescriptorType:                   0x24
bDescriptorSubtype:                0x07
bFrameIndex:                       0x03
bmCapabilities:                    0x00
wWidth:                          0x0780 = 1920
wHeight:                         0x0438 = 1080
dwMinBitRate:                0x13C68000
dwMaxBitRate:                0x3B538000
dwMaxVideoFrameBufferSize:   0x003F4800
dwDefaultFrameInterval:      0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType:                0x03
===>Additional Discrete Frame TypeData
dwFrameInterval[1]:          0x00051615 = 33.333300 mSec (30.00 Hz)
dwFrameInterval[2]:          0x000A2C2A = 66.666600 mSec (15.00 Hz)
dwFrameInterval[3]:          0x000F4240 = 100.000000 mSec (10.00 Hz)

VS_FORMAT_FRAME_BASED和VS_FRAME_FRAME_BASED的YUV格式描述符:

bFormatIndex bFrameIndex 分辩率及及帧率
2 1 640x480x(30,15,10)
2 2 1280x720x(30,15,10)
  ===>Video Streaming Uncompressed Format Type Descriptor<===
bLength:                           0x1B
bDescriptorType:                   0x24
bDescriptorSubtype:                0x04
bFormatIndex:                      0x02
bNumFrameDescriptors:              0x02
guidFormat:                        {32595559-0000-0010-8000-00AA00389B71} = YUY2 Format
bBitsPerPixel:                     0x10
bDefaultFrameIndex:                0x01
bAspectRatioX:                     0x00
bAspectRatioY:                     0x00
bmInterlaceFlags:                  0x00
     D0    = 0x00 Interlaced stream or variable: No
     D1    = 0x00 Fields per frame: 2 fields
     D2    = 0x00 Field 1 first: No
     D3    = 0x00 Reserved
     D4..5 = 0x00 Field patterns  -> Field 1 only
     D6..7 = 0x00 Display Mode  -> Bob only
bCopyProtect:                      0x00  -> Duplication Unrestricted

          ===>Video Streaming Uncompressed Frame Type Descriptor<===
          --->This is the Default (optimum) Frame index
bLength:                           0x26
bDescriptorType:                   0x24
bDescriptorSubtype:                0x05
bFrameIndex:                       0x01
bmCapabilities:                    0x00
wWidth:                          0x0280 = 640
wHeight:                         0x01E0 = 480
dwMinBitRate:                0x02EE0000
dwMaxBitRate:                0x08CA0000
dwMaxVideoFrameBufferSize:   0x00096000
dwDefaultFrameInterval:      0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType:                0x03
===>Additional Discrete Frame Type Data
dwFrameInterval[1]:          0x00051615 = 33.333300 mSec (30.00 Hz)
dwFrameInterval[2]:          0x000A2C2A = 66.666600 mSec (15.00 Hz)
dwFrameInterval[3]:          0x000F4240 = 100.000000 mSec (10.00 Hz)

          ===>Video Streaming Uncompressed Frame Type Descriptor<===
bLength:                           0x26
bDescriptorType:                   0x24
bDescriptorSubtype:                0x05
bFrameIndex:                       0x02
bmCapabilities:                    0x00
wWidth:                          0x0500 = 1280
wHeight:                         0x02D0 = 720
dwMinBitRate:                0x08CA0000
dwMaxBitRate:                0x1A5E0000
dwMaxVideoFrameBufferSize:   0x001C2000
dwDefaultFrameInterval:      0x00051615 = 33.333300 mSec (30.00 Hz)
bFrameIntervalType:                0x03
===>Additional Discrete Frame Type Data
dwFrameInterval[1]:          0x00051615 = 33.333300 mSec (30.00 Hz)
dwFrameInterval[2]:          0x000A2C2A = 66.666600 mSec (15.00 Hz)
dwFrameInterval[3]:          0x000F4240 = 100.000000 mSec (10.00 Hz)

H264数据格式


        ---- VS Frame Based Payload Format Type Descriptor ----
*!*ERROR: This format is NOT ALLOWED for UVC 1.0 devices
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x10 (Frame Based Format Type)
bFormatIndex             : 0x03 (3)
bNumFrameDescriptors     : 0x03 (3)
guidFormat               : {34363248-0000-0010-8000-00AA00389B71} (H264)
bBitsPerPixel            : 0x10 (16 bits)
bDefaultFrameIndex       : 0x03 (3)
bAspectRatioX            : 0x00
bAspectRatioY            : 0x00
bmInterlaceFlags         : 0x00
 D0 IL stream or variable: 0 (no)
 D1 Fields per frame     : 0 (2 fields)
 D2 Field 1 first        : 0 (no)
 D3 Reserved             : 0
 D4..5 Field pattern     : 0 (Field 1 only)
 D6..7 Display Mode      : 0 (Bob only)
bCopyProtect             : 0x00 (No restrictions)
bVariableSize            : 0x01 (Variable Size)
*!*ERROR:  Found 6 frame descriptors (should be 3)
Data (HexDump)           : 1C 24 10 03 03 48 32 36 34 00 00 10 00 80 00 00   .$...H264.......
                           AA 00 38 9B 71 10 03 00 00 00 00 01               ..8.q.......

GUID来源于:https://uuid.pirate-server.com/

帧格式为:
第一个为640X480

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x01
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x01E0 (480)
dwMinBitRate             : 0x02EE0000 (49152000 bps -> 6.144 MB/s)
dwMaxBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 01 00 80 02 E0 01 00 00 EE 02 00 00 CA   &$..............
                           08 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ..............*,
                           0A 00 40 42 0F 00                                 ..@B..

第二个为1280x720

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x02
bmCapabilities           : 0x00
wWidth                   : 0x0500 (1280)
wHeight                  : 0x02D0 (720)
dwMinBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxBitRate             : 0x1A5E0000 (442368000 bps -> 55.296 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 02 00 00 05 D0 02 00 00 CA 08 00 00 5E   &$.............^
                           1A 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ..............*,
                           0A 00 40 42 0F 00                                 ..@B..

第三个为:1920x1080

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x03
bmCapabilities           : 0x00
wWidth                   : 0x0780 (1920)
wHeight                  : 0x0438 (1080)
dwMinBitRate             : 0x13C68000 (331776000 bps -> 41.472 MB/s)
dwMaxBitRate             : 0x3B538000 (995328000 bps -> 124.416 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 03 00 80 07 38 04 00 80 C6 13 00 80 53   &$.....8.......S
                           3B 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ;.............*,
                           0A 00 40 42 0F 00                                 ..@B..

H265数据格式

  ---- VS Frame Based Payload Format Type Descriptor ----
*!*ERROR: This format is NOT ALLOWED for UVC 1.0 devices
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x10 (Frame Based Format Type)
bFormatIndex             : 0x04 (4)
bNumFrameDescriptors     : 0x03 (3)
guidFormat               : {35363248-0000-0010-8000-00AA00389B71} (H265)
bBitsPerPixel            : 0x10 (16 bits)
bDefaultFrameIndex       : 0x03 (3)
bAspectRatioX            : 0x00
bAspectRatioY            : 0x00
bmInterlaceFlags         : 0x00
 D0 IL stream or variable: 0 (no)
 D1 Fields per frame     : 0 (2 fields)
 D2 Field 1 first        : 0 (no)
 D3 Reserved             : 0
 D4..5 Field pattern     : 0 (Field 1 only)
 D6..7 Display Mode      : 0 (Bob only)
bCopyProtect             : 0x00 (No restrictions)
bVariableSize            : 0x01 (Variable Size)
Data (HexDump)           : 1C 24 10 04 03 48 32 36 35 00 00 10 00 80 00 00   .$...H265.......
                           AA 00 38 9B 71 10 03 00 00 00 00 01               ..8.q.......

帧格式为:
第一个为640X480

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x01
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x01E0 (480)
dwMinBitRate             : 0x02EE0000 (49152000 bps -> 6.144 MB/s)
dwMaxBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 01 00 80 02 E0 01 00 00 EE 02 00 00 CA   &$..............
                           08 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ..............*,
                           0A 00 40 42 0F 00                                 ..@B..

第二个为1280x720

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x02
bmCapabilities           : 0x00
wWidth                   : 0x0500 (1280)
wHeight                  : 0x02D0 (720)
dwMinBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxBitRate             : 0x1A5E0000 (442368000 bps -> 55.296 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 02 00 00 05 D0 02 00 00 CA 08 00 00 5E   &$.............^
                           1A 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ..............*,
                           0A 00 40 42 0F 00                                 ..@B..

第三个为:1920x1080

        ----- VS Frame Based Payload Frame Type Descriptor ----
*!*ERROR  bDescriptorSubtype did not exist in UVC 1.0
bLength                  : 0x26 (38 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x11 (Frame Based Payload Frame Type)
bFrameIndex              : 0x03
bmCapabilities           : 0x00
wWidth                   : 0x0780 (1920)
wHeight                  : 0x0438 (1080)
dwMinBitRate             : 0x13C68000 (331776000 bps -> 41.472 MB/s)
dwMaxBitRate             : 0x3B538000 (995328000 bps -> 124.416 MB/s)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x03 (3 discrete frame intervals supported)
dwBytesPerLine           : 0x00 (0 bytes)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
adwFrameInterval[2]      : 0x000A2C2A (66.6666 ms -> 15.000 fps)
adwFrameInterval[3]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 26 24 11 03 00 80 07 38 04 00 80 C6 13 00 80 53   &$.....8.......S
                           3B 15 16 05 00 03 00 00 00 00 15 16 05 00 2A 2C   ;.............*,
                           0A 00 40 42 0F 00                                 ..@B..

颜色匹配描述符

          ===>Color Matching Descriptor<===
bLength:                           0x06
bDescriptorType:                   0x24
bDescriptorSubtype:                0x0D
bColorPrimaries:                   0x01
bTransferCharacteristics:          0x01
bMatrixCoefficients:               0x04

用于转换的接口描述符,包含一个81端点用于数据接收视频数据,方式为等时/同步传输方式。


          ===>Interface Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x04
bInterfaceNumber:                  0x01
bAlternateSetting:                 0x01
bNumEndpoints:                     0x01
bInterfaceClass:                   0x0E  -> Video Interface Class
bInterfaceSubClass:                0x02  -> Video Streaming Interface SubClass
bInterfaceProtocol:                0x00
iInterface:                        0x06
     English (United States)  "Video Streaming"

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x81  -> Direction: IN - EndpointID: 1
bmAttributes:                      0x05  -> Isochronous Transfer Type, Synchronization Type = Asynchronous, Usage Type = Data Endpoint
wMaxPacketSize:                  0x1400 = 3 transactions per microframe, 0x400 max bytes
bInterval:                         0x01
HID人机交互QQ群:564808376    UAC音频QQ群:218581009    UVC相机QQ群:331552032    BOT&UASP大容量存储QQ群:258159197    STC-USB单片机QQ群:315457461    USB技术交流QQ群2:580684376    USB技术交流QQ群:952873936   

0 篇笔记 写笔记

UVC 扩展单元描述符
扩展单元描述符允许硬件设计者定义任意一组控制接口,使类驱动程序可以在设备与供应商提供的主机软件之间进行通讯控制。扩展单元描述符ID由bUnitID字段中的值唯一标识描述符。同一视频功能内的任何其他单元或终端不得具有相同的功能ID。guidExtensionCode字段包含特定于供应商的代码,该代......
Linux V4L2 UVC摄像头框架浅析
V4L2 :video for linux version 2 ,是 Linux 里一套标准的视频驱动,它支持 UVC 标准的摄像头。本文来分析一下它的核心框架。整个v4l2的框架分为三层:在应用层,我们可以在 /dev 目录发现 video0 类似的设备节点,上层的摄像头程序打开设备节点进行......
打开UVC摄像头(特定类请求)数据分析
通过上节可以知道,设备支持4种的视频格式,且每种格式如下:MPJPG数据格式bFormatIndexbFrameIndex分辩率及及帧率11640x480x(30,15,10)121280x720x(30,15,10)131920x1080x(30,15......
UVC 视频流接口VS
和视频控制接口不同,视频流接口用于主机和设备视频功能之间进行传输视频数据。一个视频功能可以不包括视频流接口,也可以包含多个视频流接口。视频流接口用于传输视频时,其传输端点为等时/同步传输端点或者批量传输端点。视频流接口用于传输静止图像时,其传输类型为批量传输端点。用于静止图片传输是可选的,不是必须的......
UVC 请求错误码控制
请求错误码控制用于返回主机初始化后各单元、终端、端点的状态。bmRequestTypebRequestwValuewIndexwLengthData10100001GET_CURGET_INFO02接口1bDevicePowerModebDevicePowerMode:0x00:无错误,请求成功。0......
UVC摄像头扩展单元功能的开发步骤是什么?
写在扩展单元的题外话本人在开发支持UVC扩展单元的directShow应用时,必现并不需要注册接口,只需要在其源过滤器参照后续的代码枚举相关的接口如IKsControl,IKsTopologyInfo定位到指定的扩展单元接口后,直接使用其对应的IKsControl::KsProperty即可实现扩展......
UVC 描述符及描述符布局
USB设备的描述符用于向主机报告其设备的属性信息,UVC设备属于USB设备的一种,故和通用的USB设备一样,也包含设备描述符、配置描述符、接口描述符、端点描述符和字符串描述符。UVC设备在也定义了一些特有的描述符,用于对USB视频设备的扩展。这些特有的UVC描述符和通用的USB描述符,共同组成了UV......
UVC1.0和UVC 1.1有什么区别
符合uvc1.1的设备应将类特定VC接口中的bcdUVC标志设置为0x110。此外,如果存在可选的处理单元描述符,则符合1.1的设备应执行以下操作:将bmVideoStandards字段添加到处理单元描述符。更新处理单元中的bLength字段。更新wTotalLength以反映处理单元的较大PU大小......
UVC 等时传输中的URB_ISOCH_TRANSFER
通过UVC规范可知,视频图像数据的读取可使用两种端点传输方式,分别为:BULK 块/批量传输方式ISO 等时/同步传输方式在Windows内核中,USB数据的读取是通过URB来进行传输的,其结构体是一个大大的共用体,根据数据传输的方式对应其不同的结构体,其内容如下:typedef _Struct_s......
UVC摄像头的延迟reduce latency
一般的ISP,200W30帧来说,sensor进来缓存一帧就是33ms+vpu处理时间大概10ms+jpeg编码时间16ms+USB传输时间200KB大概7、8ms,最后就是windows上的显示延迟时间,如果JPEG编码出来缓存不止一帧,时间就更长了,所以一般会超过100多ms另外,网络传输如使......
UVC 相机终端描述符
相机端点描述符使用bTerminalID来标识其惟一的ID,所有的请求必须使用此ID。wTerminalType用来描述相关的物理实体的信息。typedef struct _CAMERA_TERMINAL_DESCRIPTOR UINT8 bLength; UINT8 bDescr......
UVC Windows下UVC摄像头数据分析
这里我们分析一款UVC摄像头来进行数据分析。环境:win10 x64工具:bushound,usbviewer将摄像头插入PC后,打开usbviewer工具,可以看到关于此摄像头的相关信息。可以看到,这个摄像头其实是一个USB复合设备,所以其对应的系统驱动为USBCCGP,然后再由USB复合设......
UVC 选择单元控制请求
选择单元控制描述符设置或读取视频功能的选择器单元内的选择器控件的属性。选择器单元表示视频流源选择器。CUR、MIN和MAX属性的有效范围是从1到选择器单元的输入管脚数。这个值可以在选择器单元描述符的bNrInPins字段中找到。RES属性只能有一个值。控制选择子SU_INPUT_SELECT_CON......
DirectShow播放UVC设备第二路码流方法
双码流播放Graphi图如上。双码流视频设备有两路捕获输出pin, RenderStream函数只会连接第一路pin,要播放第二路码流需要手动获取第二路pin,然后去连接解码器,再手动连接render,就可以显示了。示例代码// m_pGB 是 IGraphBuilder对象// m_pBF......
UVC的版本区别之处理单元描述符
UVC规范自发布到现在,已经有UVC1.0,UVC1.1和UVC1.5三个版本了。在Windows环境下,支持的最广泛的是UVC1.0,从Win7开始支持UVC1.1,从Win8开始支持UVC1.5.我们常用的UVC摄像头一般为了支持更加广泛的操作系统,一般情况下UVC的固件是UVC1.0,但随着固......
关注公众号
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!