UVC摄像头技术笔记
+ -

UVC修改相机分辨率帧率

2022-03-31 2796 0

熟悉UVC规范的都知道,UVC摄像头或相机可以通过UVC视频流接口支持多种分辨率和格式,但是一般都会有一个默认的视频数据格式和分辨率。
如本人手中的一个UVC摄像头,可以看到其支持多种格式和分辨率,我们可以通过potplayer来查看。
相机分辨率
可以看到,其支持MJPG,YUY2两种各式和多种的分辨率。
当然,这些信息也是可通过USBTREEViewer来查看其视频流接口的描述符。

        ----- Video Streaming MJPEG Format Type Descriptor ----
bLength                  : 0x0B (11 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x06 (Format MJPEG)
bFormatIndex             : 0x01 (1)
bNumFrameDescriptors     : 0x05 (5)
bmFlags                  : 0x00 (Sample size is not fixed)
bDefaultFrameIndex       : 0x01 (1)
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)
*!*ERROR:  no Color Matching Descriptor for this format
Data (HexDump)           : 0B 24 06 01 05 00 01 00 00 00 00                  .$.........

        ----- Video Streaming MJPEG Frame Type Descriptor -----
---> This is the Default (optimum) Frame index
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
bFrameIndex              : 0x01
bmCapabilities           : 0x00
wWidth                   : 0x0500 (1280)
wHeight                  : 0x02D0 (720)
dwMinBitRate             : 0x1A5E0000 (442368000 bps -> 55.296 MB/s)
dwMaxBitRate             : 0x1A5E0000 (442368000 bps -> 55.296 MB/s)
dwMaxVideoFrameBufferSize: 0x001C224D (1843789 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 07 01 00 00 05 D0 02 00 00 5E 1A 00 00 5E   .$.........^...^
                           1A 4D 22 1C 00 15 16 05 00 01 15 16 05 00         .M"...........

        ----- Video Streaming MJPEG Frame Type Descriptor -----
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
bFrameIndex              : 0x02
bmCapabilities           : 0x00
wWidth                   : 0x03C0 (960)
wHeight                  : 0x021C (540)
dwMinBitRate             : 0x0ED4E000 (248832000 bps -> 31.104 MB/s)
dwMaxBitRate             : 0x0ED4E000 (248832000 bps -> 31.104 MB/s)
dwMaxVideoFrameBufferSize: 0x000FD44D (1037389 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 07 02 00 C0 03 1C 02 00 E0 D4 0E 00 E0 D4   .$..............
                           0E 4D D4 0F 00 15 16 05 00 01 15 16 05 00         .M............

        ----- Video Streaming MJPEG Frame Type Descriptor -----
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
bFrameIndex              : 0x03
bmCapabilities           : 0x00
wWidth                   : 0x0350 (848)
wHeight                  : 0x01E0 (480)
dwMinBitRate             : 0x0BA54000 (195379200 bps -> 24.422 MB/s)
dwMaxBitRate             : 0x0BA54000 (195379200 bps -> 24.422 MB/s)
dwMaxVideoFrameBufferSize: 0x000C6E4D (814669 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 07 03 00 50 03 E0 01 00 40 A5 0B 00 40 A5   .$...P....@...@.
                           0B 4D 6E 0C 00 15 16 05 00 01 15 16 05 00         .Mn...........

        ----- Video Streaming MJPEG Frame Type Descriptor -----
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
bFrameIndex              : 0x04
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x01E0 (480)
dwMinBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxVideoFrameBufferSize: 0x0009624D (614989 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 07 04 00 80 02 E0 01 00 00 CA 08 00 00 CA   .$..............
                           08 4D 62 09 00 15 16 05 00 01 15 16 05 00         .Mb...........

        ----- Video Streaming MJPEG Frame Type Descriptor -----
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x07 (MJPEG Frame Type)
bFrameIndex              : 0x05
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x0168 (360)
dwMinBitRate             : 0x06978000 (110592000 bps -> 13.824 MB/s)
dwMaxBitRate             : 0x06978000 (110592000 bps -> 13.824 MB/s)
dwMaxVideoFrameBufferSize: 0x00070A4D (461389 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 07 05 00 80 02 68 01 00 80 97 06 00 80 97   .$.....h........
                           06 4D 0A 07 00 15 16 05 00 01 15 16 05 00         .M............

        ------- VS Uncompressed Format Type Descriptor --------
bLength                  : 0x1B (27 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x04 (Uncompressed Format Type)
bFormatIndex             : 0x02 (2)
bNumFrameDescriptors     : 0x07 (7 Frame Descriptors)
guidFormat               : {32595559-0000-0010-8000-00AA00389B71} (YUY2)
bBitsPerPixel            : 0x10 (16 bits per pixel)
bDefaultFrameIndex       : 0x01 (Index 1)
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)
Data (HexDump)           : 1B 24 04 02 07 59 55 59 32 00 00 10 00 80 00 00   .$...YUY2.......
                           AA 00 38 9B 71 10 01 00 00 00 00                  ..8.q......

        -------- VS Uncompressed Frame Type Descriptor --------
---> This is the Default (optimum) Frame index
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x01
bmCapabilities           : 0x00
wWidth                   : 0x0500 (1280)
wHeight                  : 0x02D0 (720)
dwMinBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxVideoFrameBufferSize: 0x001C2000 (1843200 bytes)
dwDefaultFrameInterval   : 0x000F4240 (100.0000 ms -> 10.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x000F4240 (100.0000 ms -> 10.000 fps)
Data (HexDump)           : 1E 24 05 01 00 00 05 D0 02 00 00 CA 08 00 00 CA   .$..............
                           08 00 20 1C 00 40 42 0F 00 01 40 42 0F 00         .. ..@B...@B..

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x02
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x01E0 (480)
dwMinBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxBitRate             : 0x08CA0000 (147456000 bps -> 18.432 MB/s)
dwMaxVideoFrameBufferSize: 0x00096000 (614400 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 02 00 80 02 E0 01 00 00 CA 08 00 00 CA   .$..............
                           08 00 60 09 00 15 16 05 00 01 15 16 05 00         ..`...........

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x03
bmCapabilities           : 0x00
wWidth                   : 0x0280 (640)
wHeight                  : 0x0168 (360)
dwMinBitRate             : 0x06978000 (110592000 bps -> 13.824 MB/s)
dwMaxBitRate             : 0x06978000 (110592000 bps -> 13.824 MB/s)
dwMaxVideoFrameBufferSize: 0x00070800 (460800 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 03 00 80 02 68 01 00 80 97 06 00 80 97   .$.....h........
                           06 00 08 07 00 15 16 05 00 01 15 16 05 00         ..............

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x04
bmCapabilities           : 0x00
wWidth                   : 0x01A8 (424)
wHeight                  : 0x00F0 (240)
dwMinBitRate             : 0x02E95000 (48844800 bps -> 6.105 MB/s)
dwMaxBitRate             : 0x02E95000 (48844800 bps -> 6.105 MB/s)
dwMaxVideoFrameBufferSize: 0x00031B00 (203520 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 04 00 A8 01 F0 00 00 50 E9 02 00 50 E9   .$........P...P.
                           02 00 1B 03 00 15 16 05 00 01 15 16 05 00         ..............

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x05
bmCapabilities           : 0x00
wWidth                   : 0x0140 (320)
wHeight                  : 0x00F0 (240)
dwMinBitRate             : 0x02328000 (36864000 bps -> 4.608 MB/s)
dwMaxBitRate             : 0x02328000 (36864000 bps -> 4.608 MB/s)
dwMaxVideoFrameBufferSize: 0x00025800 (153600 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 05 00 40 01 F0 00 00 80 32 02 00 80 32   .$...@.....2...2
                           02 00 58 02 00 15 16 05 00 01 15 16 05 00         ..X...........

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x06
bmCapabilities           : 0x00
wWidth                   : 0x0140 (320)
wHeight                  : 0x00B4 (180)
dwMinBitRate             : 0x01A5E000 (27648000 bps -> 3.456 MB/s)
dwMaxBitRate             : 0x01A5E000 (27648000 bps -> 3.456 MB/s)
dwMaxVideoFrameBufferSize: 0x0001C200 (115200 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 06 00 40 01 B4 00 00 E0 A5 01 00 E0 A5   .$...@..........
                           01 00 C2 01 00 15 16 05 00 01 15 16 05 00         ..............

        -------- VS Uncompressed Frame Type Descriptor --------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x24 (Video Streaming Interface)
bDescriptorSubtype       : 0x05 (Uncompressed Frame Type)
bFrameIndex              : 0x07
bmCapabilities           : 0x00
wWidth                   : 0x00A0 (160)
wHeight                  : 0x0078 (120)
dwMinBitRate             : 0x008CA000 (9216000 bps -> 1.152 MB/s)
dwMaxBitRate             : 0x008CA000 (9216000 bps -> 1.152 MB/s)
dwMaxVideoFrameBufferSize: 0x00009600 (38400 bytes)
dwDefaultFrameInterval   : 0x00051615 (33.3333 ms -> 30.000 fps)
bFrameIntervalType       : 0x01 (1 discrete frame interval supported)
adwFrameInterval[1]      : 0x00051615 (33.3333 ms -> 30.000 fps)
Data (HexDump)           : 1E 24 05 07 00 A0 00 78 00 00 A0 8C 00 00 A0 8C   .$.....x........
                           00 00 96 00 00 15 16 05 00 01 15 16 05 00         ..............

可以看到,这是和通过PotPlayer枚举出来的是一样的,其中MJPG的1280x720x30的为默认分辨率。其对应的FormatIndex=1,FrameIndex=1,我们通过Potplayer打开其默认格式(推荐),通过BUSHOUND抓包来分析其USB视频流接口协商过程。

Length    Phase  Data                                                Description     
--------  -----  --------------------------------------------------  ----------------
          CTL    21 01 00 05  00 02 01 00                            SET CUR         
       1  OUT    02                                                  .               
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR         
      26  IN     00 00 01 01  80 1a 06 00  00 00 00 00  00 00 1e 00  ................
                 00 00 00 00  00 00 00 00  00 00                     ..........      
          CTL    21 01 00 01  01 00 1a 00                            SET CUR         
      26  OUT    00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ................
                 00 00 00 00  00 00 00 00  00 00                     ..........      
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR         
      26  IN     00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ................
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"......      
          CTL    a1 83 00 01  01 00 1a 00                            GET MAX         
      26  IN     00 00 01 01  15 16 05 00  00 00 00 00  00 00 00 00  ................
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"......      
          CTL    a1 82 00 01  01 00 1a 00                            GET MIN         
      26  IN     00 00 01 01  15 16 05 00  00 00 00 00  00 00 00 00  ................
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"......      
          CTL    21 01 00 01  01 00 1a 00                            SET CUR         
      26  OUT    00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ................
                 00 00 4d 22  1c 00 00 00  00 00                     ..M"......      
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR         
      26  IN     00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ................
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"......      
          CTL    21 01 00 02  01 00 1a 00                            SET CUR         
      26  OUT    00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ................
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"......

使用UVC视频协商工具 http://www.usbzh.com/tool/uvc.html 分析其最后的VS_COMMIT_CONTROL数据内容:

----------------------------------
 USB中文网 http://www.usbzh.com 
----------------------------------

============UVC1.0============ 

0x00, 0x00,  UINT16 bmHint;
0x01, UINT8 bFormatIndex=1,
0x01, UINT8 bFrameIndex=1,
0x15, 0x16, 0x05, 0x00, UINT32 dwFrameInterval=333333,;33.3333,ms/帧
0x00, 0x00, UINT16 wKeyFrameRate=0,;缩格式中只有第1帧为关键帧;
0x00, 0x00, UINT16 wPFrameRate=0,;压缩格式P帧速率;
0x00, 0x00, UINT16 wCompQuality=0,,压缩质量1-10000;
0x1E, 0x00, UINT16 wCompWindowSize;30,,平均比特率控制的窗口大小;
0x00, 0x00, UINT16 wDelay;0,,内部视频流接口延迟(毫秒);
0x4D, 0x22, 0x1C, 0x00, UINT32 dwMaxVideoFrameSize;1843789,Bytes
0x00, 0x0C, 0x00, 0x00, UINT32 dwMaxPayloadTransferSize;3072,Bytes

// 26 bytes

可以看到,其bFormatIndex=1和bFrameIndex=1。
但是如果我们改变相机分辨率呢?
这个其实很简单,只选在重新打开摄像头时,选择其对应的格式和分辨率即可,这样USB视频驱动会自动与固件协商相应的格式进行通讯。

修改帧率也是一样的,只是VS_COMMIT_CONTROL的数据中的dwFrameInterval改成其指定的即可。

如我们想打开YUY2 1280x720x10的格式,其协VS_COMMIT_CONTROL数据内容如下:

Length    Phase  Data                                                Descript
--------  -----  --------------------------------------------------  --------
          CTL    21 01 00 05  00 02 01 00                            SET CUR 
       1  OUT    02                                                  .       
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR 
      26  IN     00 00 01 01  15 16 05 00  00 00 00 00  00 00 1e 00  ........
                 00 00 4d 22  1c 00 00 0c  00 00                     ..M"....
          CTL    21 01 00 01  01 00 1a 00                            SET CUR 
      26  OUT    00 00 02 01  40 42 0f 00  00 00 00 00  00 00 1e 00  ....@B..
                 00 00 4d 22  1c 00 00 00  00 00                     ..M"....
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR 
      26  IN     00 00 02 01  40 42 0f 00  00 00 00 00  00 00 1e 00  ....@B..
                 00 00 00 20  1c 00 00 0c  00 00                     ... ....
          CTL    a1 83 00 01  01 00 1a 00                            GET MAX 
      26  IN     00 00 02 01  40 42 0f 00  00 00 00 00  00 00 00 00  ....@B..
                 00 00 00 20  1c 00 00 0c  00 00                     ... ....
          CTL    a1 82 00 01  01 00 1a 00                            GET MIN 
      26  IN     00 00 02 01  40 42 0f 00  00 00 00 00  00 00 00 00  ....@B..
                 00 00 00 20  1c 00 00 0c  00 00                     ... ....
          CTL    21 01 00 01  01 00 1a 00                            SET CUR 
      26  OUT    00 00 02 01  40 42 0f 00  00 00 00 00  00 00 1e 00  ....@B..
                 00 00 00 20  1c 00 00 00  00 00                     ... ....
          CTL    a1 81 00 01  01 00 1a 00                            GET CUR 
      26  IN     00 00 02 01  40 42 0f 00  00 00 00 00  00 00 1e 00  ....@B..
                 00 00 00 20  1c 00 00 0c  00 00                     ... ....
          CTL    21 01 00 02  01 00 1a 00                            SET CUR 
      26  OUT    00 00 02 01  40 42 0f 00  00 00 00 00  00 00 1e 00  ....@B..
                 00 00 00 20  1c 00 00 0c  00 00                     ... ....

分析其协VS_COMMIT_CONTROL数据内容

----------------------------------
 USB中文网 http://www.usbzh.com 
----------------------------------

============UVC1.0============ 

0x00, 0x00,  UINT16 bmHint;
0x02, UINT8 bFormatIndex=2,
0x01, UINT8 bFrameIndex=1,
0x40, 0x42, 0x0F, 0x00, UINT32 dwFrameInterval=1000000,;100,ms/帧
0x00, 0x00, UINT16 wKeyFrameRate=0,;缩格式中只有第1帧为关键帧;
0x00, 0x00, UINT16 wPFrameRate=0,;压缩格式P帧速率;
0x00, 0x00, UINT16 wCompQuality=0,,压缩质量1-10000;
0x1E, 0x00, UINT16 wCompWindowSize;30,,平均比特率控制的窗口大小;
0x00, 0x00, UINT16 wDelay;0,,内部视频流接口延迟(毫秒);
0x00, 0x20, 0x1C, 0x00, UINT32 dwMaxVideoFrameSize;1843200,Bytes
0x00, 0x0C, 0x00, 0x00, UINT32 dwMaxPayloadTransferSize;3072,Bytes

// 26 bytes

可以看到,bFormatIndex=2, bFrameIndex=1,并且UINT32 dwFrameInterval=1000000,;100,ms/帧,这个和我们的视频接口描述符中的地应一致。

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 篇笔记 写笔记

Directshow获取颜色空间分辨率
void GetColorSpaceResolution(){ HRESULT hr; AM_MEDIA_TYPE *pmt = NULL; VIDEOINFOHEADER *pvi = NULL; VIDEO_STREAM_CONFIG_CAPS scc; IAMSt......
Directshow修改摄像头分辨率
在用directshow开发时可能需要修改视频的分辨率便于网络传输,可以用如下方法:IAMStreamConfig *pSC=NULL; VIDEOINFOHEADER *vinfo=0; hr= pBuilder2->FindInterface(&PIN_CATEGORY_C......
UVC修改相机分辨率帧率
熟悉UVC规范的都知道,UVC摄像头或相机可以通过UVC视频流接口支持多种分辨率和格式,但是一般都会有一个默认的视频数据格式和分辨率。如本人手中的一个UVC摄像头,可以看到其支持多种格式和分辨率,我们可以通过potplayer来查看。可以看到,其支持MJPG,YUY2两种各式和多种的分辨率。当然,这......
UVC相机拓扑结构配置要点总结
UVC相机开发的人经常是需要编写UVC相机配置描述符的,这个USB配置描述符包括两部分的内容,分别为视频控制接口部分和视频流接口部分。视频控制部分包括的内容主要描述了UVC相机的拓扑结构。一般情况下的相机拓扑结构是这样子的:不过有的时候,我们也需要扩展单元,所以加上扩展单元描述符就如下:这里......
UVC相机配置描述符解析
UVC相机开发的人经常是需要编写UVC相机配置描述符的,这个USB配置描述符包括两部分的内容,分别为视频控制接口部分和视频流接口部分。视频控制部分包括的内容主要描述了UVC相机的拓扑结构。视频流接口部分的内容主要描述符UVC相机支持的视频格式、分辨率及相关的数据流端点。一般情况下,我们编写UV......
UVC相机处理单元亮度、对比度、色调、饱合度和锐度抓包分析实践
UVC的拓扑结构中,有一个叫做处理单,其主要功能是设置或读取视频函数的处理单元内的视频控件的属性。这些属性主要是相机图显上的参数配置。根据UVC规范,相机处理单元支持的功能通过其UVC相机处理单元描述符bmControls字段的位域掩码来表示,其对应的值为1表示支持,为0表示不支持。具体支持的各......
LINUX&UVC相机打开时的带宽选择
UVC规范明确指出,传输UVC图像数据的端点既可以是同步传输,也可以是批量传输。批量传输对于批量传输,其实根本不存在带宽选择的问题的。只要是批量传输,端点都是可以使能工作的,但是数据传输的效能是根据USB总线上的带宽利用率而决定的。因为USB批量占用的是周期性传输和控制传输剩余的带宽。USB带......
LINUX打开UVC相机代码
打开 /dev/video0 设备。查询设备的基本能力,并打印驱动程序、设备名称等信息。设置视频格式为 640x480 分辨率,YUYV 格式,交错扫描。请求 4 个内存缓冲区用于视频数据。将这些缓冲区映射到用户空间。将缓冲区放入视频队列。开始数据流。在需要时,可以添加视频处理或保存的代码。停止数......
LINUX&UVC驱动枚举视频帧大小和帧率
UVC视频分为视频格式、帧大小及帧率。不过一般帧率和帧大小(分辨率)合并在一起的。视频格式通过VIDIOC_ENUM_FMT获取到,但该视频格式下可能支持多种帧率和帧大小(分辨率)。故在应用层通过VIDIOC_ENUM_FRAMESIZES控制码来枚举该视频格式下的帧分辨率帧率。帧分辨率在UVCC......
UVC相机配置描述符-BULK批量传输-NV12-H265
格式概述格式分辨率NV12640X360x30H2653840X2160X30传输方式批量传输,BULK模式功能支持处理单元D0:亮度D1:对比度D2:色调D3:饱和D4:锐度扩展单元选择子9-11D0的选择子为1视频流端点地址0x81其它附......
Sonix-UVC相机描述符-同步传输-MJPG-YUY2
相机格式和分辨率格式分辨率MJPG1280X720x30MJPG960x540x30MJPG848x480x30MJPG640x480x30MJPG640x320x30YUY21280X720X10YUY2640X480X10......
UVC相机-批量传输MJPG-4K
MJPG 3840X2160X30 =========================== USB Port20 ===========================Connection Status : 0x01 (Device is connected)Port ......
关注公众号
  • HID人机交互
  • Linux&USB
  • UAC音频
  • TYPE-C
  • USB规范
  • USB大容量存储
  • USB百科
  • USB周边
  • UVC摄像头
  • Windows系统USB
  • 音视频博客
  • 取消
    感谢您的支持,我会继续努力的!
    扫码支持
    扫码打赏,你说多少就多少

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

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