我想问一下是否有任何选项可以在 Windows 上获取 dshow 设备格式列表。
例如,在 Linux 上,我可以通过以下方式获取 Linux 上的设备格式列表
v4l2-ctl -i /dev/video0 --list-formats
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Index : 1
Type : Video Capture
Pixel Format: 'H264' (compressed)
Name : H.264
Index : 2
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
Run Code Online (Sandbox Code Playgroud)
在 Windows 上,我能够获取设备列表
ffmpeg -list_devices true -f dshow -i dummy
Run Code Online (Sandbox Code Playgroud)
和设备选项
ffmpeg -f dshow -list_options true -i video="MY_DSHOW_DEVICE_NAME"
Run Code Online (Sandbox Code Playgroud)
但我无法获取格式列表,就像在 Linux 上通过 v4l2 一样。
如何在 Windows 上通过 FFmpeg 获取 dshow 设备支持的格式列表?
延迟回答你的问题。
不可能清楚地理解“格式列表”的含义,但是如果您参考Pixel Format使用时出现的,那么您可以从您提到的命令v4l2的输出中获取此数据。-list_options
例如,在我的笔记本电脑上,运行时有以下输出ffmpeg -f dshow -list_options true -i video ="Integrated Webcam":
(为了方便查看,省略第一行)
[dshow @ 000001cc91eea4c0] DirectShow video device options (from video devices)
[dshow @ 000001cc91eea4c0] Pin "Capture" (alternative pin name "0")
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=960x540 fps=30 max s=960x540 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=960x540 fps=30 max s=960x540 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=848x480 fps=30 max s=848x480 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=848x480 fps=30 max s=848x480 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 000001cc91eea4c0] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=640x480 fps=30 max s=640x480 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=640x480 fps=30 max s=640x480 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=160x120 fps=30 max s=160x120 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=160x120 fps=30 max s=160x120 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=320x180 fps=30 max s=320x180 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=320x180 fps=30 max s=320x180 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=320x240 fps=30 max s=320x240 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=320x240 fps=30 max s=320x240 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=424x240 fps=30 max s=424x240 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=424x240 fps=30 max s=424x240 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=640x360 fps=30 max s=640x360 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=640x360 fps=30 max s=640x360 fps=30
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=1280x720 fps=10 max s=1280x720 fps=10
[dshow @ 000001cc91eea4c0] pixel_format=yuyv422 min s=1280x720 fps=10 max s=1280x720 fps=10
Run Code Online (Sandbox Code Playgroud)
vcodec正如您所看到的,和键中包含的数据与您在'spixel_format中找到的值相同,在本例中分别为和。v4l2Pixel Formatmjpegyuyv422
如果您想要的是与 具有相同文本格式的输出v4l2,那么我知道这可以使用正则表达式来解决,例如,它与 没有直接关系FFmpeg。
| 归档时间: |
|
| 查看次数: |
16326 次 |
| 最近记录: |