通过软件捕获 USB type C 视频
Capturing USB type C video through software
所以,我只是在想一件事:
理论上是否可以将诸如带有 USB-C 的 Switch 之类的东西连接到 PC,并通过软件执行类似于模拟捕获卡的操作。我阅读了一些关于 C 型规格的资料,但我不确定这样的事情是否可行。我想像这样的事情也必须相当低级才能做到。
USB 协议组织在设备 classes 中,即大容量存储设备 Class、通信设备 Class ( CDC ) 以及 USB 视频设备 Class ( UVC ) 几乎所有现代相机设备都实现了此 UVC class 并且您可以使用 vlc
等软件捕获 UVC 设备流
https://en.wikipedia.org/wiki/USB_video_device_class
https://ubuntuforums.org/showthread.php?t=143732 - 操作方法:使用 VLC 将网络摄像头中的视频捕获到文件中
USB-C标准是连接器的物理布局,它并没有像它在device classes[=73=中的区分那样改变USB标准的基本组织结构] 因此有带有 USB-C 连接器的 UVC 设备,在互联网上搜索 'webcam USB-C' 但是 USB-C 扩展了功能 端口的 备用模式 因此还使用具有不同固件和内核模块的不同端口控制器
Alt Mode is a functional extension of USB-C which enables the USB connection to carry non-USB signals.
来源:https://blog.startech.com/post/tech-talk-using-usb-c-and-displayport-over-alt-mode/
https://en.wikipedia.org/wiki/USB-C
我不完全理解的是,如果您想通过 USB-C HDMI 交替模式 通过 USB-C 捕获 HDMI 流( https://en.wikipedia.org/wiki/HDMI#HDMI_Alternate_Mode_for_USB_Type-C ). In this case there is no USB Video Device protocol ( HDMI is a different protocol ) and the situation is more complicated, see https://superuser.com/questions/1218848/hdmi-input-through-usb-c and https://superuser.com/questions/1192638/whats-up-with-hdmi-and-displayport-over-usb-c
有可用的 HDMI-to-USB 视频采集卡将 HDMI 流转换为视频格式,然后通过 USB 视频 Class 协议传输或直接传输为原始像素数据。此原始像素数据也包含在 USB 视频 Class 协议 ( https://devtalk.nvidia.com/default/topic/970330/how-to-handle-raw-from-usb-cameras/?offset=2 ) 中:
Other video capture solutions compress your video into a container
like H.264 or Motion JPG so it’s small enough to fit across a USB 2.0
bus (a medium with a maximum data transfer rate of 60 MB/s). When it
arrives on your computer, the CPU and/or GPU need to work to
decompress this image, then re-encode it with your encoding settings.
And with this type of pre-compressed video, it’s never possible to get
back the full detail that was lost in compression.
By contrast, our AV.io family of HDMI capture cards send raw pixel
data across to your computer over USB 3.0 (max transfer of 640 MB/s).
When your software receives this stream, it doesn’t need to decode it,
so there’s less heavy lifting.
来源:https://www.epiphan.com/blog/easiest-hdmi-to-usb-converter/
原始像素数据可以在 HDMI 交替模式下通过 USB-C 传输应该可以直接从 USB-C 捕获 HDMI 流,但是有一个主要缺点:
有问题的是,在 USB(-C) 协议中,机器可以是
主机或设备或dual-role:
Devices may be hosts (DFP: Downstream-facing port) or peripherals
(UFP: Upstream-facing port). Some, such as mobile phones, can take
either role depending on what kind is detected on the other end. These
types of ports are called Dual-Role-Data (DRD) ports, which was known
as USB On-The-Go in previous specification.[12]
在一个 USB 树中只能是 一个主机,在大多数情况下,一台计算机充当主机的角色。 USB-C 输入或外围设备(如显示器)处于设备或外围设备模式。如果您无法将计算机设置为设备或外围设备模式,您将无法通过 USB-C 捕获 HDMI 信号,因为 USB 协议
关键是 USB-C 端口控制器的固件和内核模块/驱动程序
linux USB-C 内核模块在 https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci.c and https://cateee.net/lkddb/web-lkddb/TYPEC_TCPM.html 中,定义为 USB-C host or downstream-facing port only, 所以不可能用作HDMI sink or upstream-facing port 所以不可能用作为输入并从中捕获...
无法将 USB-C 端口设置为设备模式或 upstream-facing 端口模式是必须使用外部适配器的原因
作为 USB 外围设备或 upstream-facing 端口模式的 USB-C 设备的示例是 https://9to5mac.com/2016/06/04/lg-27ud88-w-usb-c-4k-monitor-macbook-review/ 因此在此设备中运行的固件通过 [=91] 处理 HDMI 流=] 连接器,但是在 USB 协议中,它实现了一个 upstream-facing 端口 ,由于实现 USB 主机或 [=55] 的硬件限制,计算机或笔记本电脑无法实现=]downstream-facing端口..
所以,我只是在想一件事: 理论上是否可以将诸如带有 USB-C 的 Switch 之类的东西连接到 PC,并通过软件执行类似于模拟捕获卡的操作。我阅读了一些关于 C 型规格的资料,但我不确定这样的事情是否可行。我想像这样的事情也必须相当低级才能做到。
USB 协议组织在设备 classes 中,即大容量存储设备 Class、通信设备 Class ( CDC ) 以及 USB 视频设备 Class ( UVC ) 几乎所有现代相机设备都实现了此 UVC class 并且您可以使用 vlc
https://en.wikipedia.org/wiki/USB_video_device_class
https://ubuntuforums.org/showthread.php?t=143732 - 操作方法:使用 VLC 将网络摄像头中的视频捕获到文件中
USB-C标准是连接器的物理布局,它并没有像它在device classes[=73=中的区分那样改变USB标准的基本组织结构] 因此有带有 USB-C 连接器的 UVC 设备,在互联网上搜索 'webcam USB-C' 但是 USB-C 扩展了功能 端口的 备用模式 因此还使用具有不同固件和内核模块的不同端口控制器
Alt Mode is a functional extension of USB-C which enables the USB connection to carry non-USB signals.
来源:https://blog.startech.com/post/tech-talk-using-usb-c-and-displayport-over-alt-mode/
https://en.wikipedia.org/wiki/USB-C
我不完全理解的是,如果您想通过 USB-C HDMI 交替模式 通过 USB-C 捕获 HDMI 流( https://en.wikipedia.org/wiki/HDMI#HDMI_Alternate_Mode_for_USB_Type-C ). In this case there is no USB Video Device protocol ( HDMI is a different protocol ) and the situation is more complicated, see https://superuser.com/questions/1218848/hdmi-input-through-usb-c and https://superuser.com/questions/1192638/whats-up-with-hdmi-and-displayport-over-usb-c
有可用的 HDMI-to-USB 视频采集卡将 HDMI 流转换为视频格式,然后通过 USB 视频 Class 协议传输或直接传输为原始像素数据。此原始像素数据也包含在 USB 视频 Class 协议 ( https://devtalk.nvidia.com/default/topic/970330/how-to-handle-raw-from-usb-cameras/?offset=2 ) 中:
Other video capture solutions compress your video into a container like H.264 or Motion JPG so it’s small enough to fit across a USB 2.0 bus (a medium with a maximum data transfer rate of 60 MB/s). When it arrives on your computer, the CPU and/or GPU need to work to decompress this image, then re-encode it with your encoding settings. And with this type of pre-compressed video, it’s never possible to get back the full detail that was lost in compression.
By contrast, our AV.io family of HDMI capture cards send raw pixel data across to your computer over USB 3.0 (max transfer of 640 MB/s). When your software receives this stream, it doesn’t need to decode it, so there’s less heavy lifting.
来源:https://www.epiphan.com/blog/easiest-hdmi-to-usb-converter/
原始像素数据可以在 HDMI 交替模式下通过 USB-C 传输应该可以直接从 USB-C 捕获 HDMI 流,但是有一个主要缺点:
有问题的是,在 USB(-C) 协议中,机器可以是 主机或设备或dual-role:
Devices may be hosts (DFP: Downstream-facing port) or peripherals (UFP: Upstream-facing port). Some, such as mobile phones, can take either role depending on what kind is detected on the other end. These types of ports are called Dual-Role-Data (DRD) ports, which was known as USB On-The-Go in previous specification.[12]
在一个 USB 树中只能是 一个主机,在大多数情况下,一台计算机充当主机的角色。 USB-C 输入或外围设备(如显示器)处于设备或外围设备模式。如果您无法将计算机设置为设备或外围设备模式,您将无法通过 USB-C 捕获 HDMI 信号,因为 USB 协议
关键是 USB-C 端口控制器的固件和内核模块/驱动程序
linux USB-C 内核模块在 https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci.c and https://cateee.net/lkddb/web-lkddb/TYPEC_TCPM.html 中,定义为 USB-C host or downstream-facing port only, 所以不可能用作HDMI sink or upstream-facing port 所以不可能用作为输入并从中捕获...
无法将 USB-C 端口设置为设备模式或 upstream-facing 端口模式是必须使用外部适配器的原因
作为 USB 外围设备或 upstream-facing 端口模式的 USB-C 设备的示例是 https://9to5mac.com/2016/06/04/lg-27ud88-w-usb-c-4k-monitor-macbook-review/ 因此在此设备中运行的固件通过 [=91] 处理 HDMI 流=] 连接器,但是在 USB 协议中,它实现了一个 upstream-facing 端口 ,由于实现 USB 主机或 [=55] 的硬件限制,计算机或笔记本电脑无法实现=]downstream-facing端口..