UVC 视频帧描述符
2020-10-20
3186
0
视频帧描述符(简称帧描述符)用于描述解码后的视频以及基于帧格式支持的静止图像帧尺寸和其他帧特定特性。帧描述符(如果需要)紧跟在相关的格式之后.
UVC已经定义的数据帧格式类型见下表(以VS_FRAME开头):
描述符类型 | 值 |
---|---|
VS_UNDEFINED | 0x00 |
VS_INPUT_HEADER | 0x01 |
VS_OUTPUT_HEADER | 0x02 |
VS_STILL_IMAGE_FRAME | 0x03 |
VS_FORMAT_UNCOMPRESSED | 0x04 |
VS_FRAME_UNCOMPRESSED | 0x05 |
VS_FORMAT_MJPEG | 0x06 |
VS_FRAME_MJPEG | 0x07 |
Reserved | 0x08 |
Reserved | 0x09 |
VS_FORMAT_MPEG2TS | 0x0A |
Reserved | 0x0B |
VS_FORMAT_DV | 0x0C |
VS_COLORFORMAT | 0x0D |
Reserved | 0x0E |
Reserved | 0x0F |
VS_FORMAT_FRAME_BASED | 0x10 |
VS_FRAME_FRAME_BASED | 0x11 |
VS_FORMAT_STREAM_BASED | 0x12 |
VS_FORMAT_H264 | 0x13 |
VS_FRAME_H264 | 0x14 |
VS_FORMAT_H264_SIMULCAST | 0x15 |
VS_FORMAT_VP8 | 0x16 |
VS_FRAME_VP8 | 0x17 |
VS_FORMAT_VP8_SIMULCAST | 0x18 |
如我们支持MJPG格式的数据,因分辨率不同而支持的帧格式不同,这里如我们支持3种分辨率的MJPG格式:
===>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)
关于不同格式的数据帧相关的详细,可在https://www.usb.org/sites/default/files/USB_Video_Class_1_5.zip 处下载对应的文档。
相应的视频帧格式详见相关文件:
Video Frame Descriptor | Document |
---|---|
Uncompressed | USB_Video_Payload_Uncompressed |
MJPEG | USB_Video_Payload_MJPEG |
Generic | Frame-Based USB_Video_Payload_Frame_Based |
H.264 | USB_Video_Payload_H.264 |
VP8 | USB_Video_Payload_VP8 |
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936