4

我想问是否有任何选项可以在 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

在 Windows 上,我可以获取设备列表

ffmpeg -list_devices true -f dshow -i dummy

和设备选项

ffmpeg -f dshow -list_options true -i video="MY_DSHOW_DEVICE_NAME"

但我无法获取格式列表,例如通过 v4l2 在 Linux 上。

如何在 Windows 上通过 FFmpeg 获取 dshow 设备支持的格式列表?

4

1 回答 1

3

延迟回答您的问题。

无法清楚地理解“格式列表”的含义,但是如果您参考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

如您所见,vcodec和键中包含的数据与您在's中pixel_format找到的值相同,在本例中分别为和。v4l2Pixel Formatmjpegyuyv422

如果您想要的是具有v4l2FFmpeg.

于 2020-05-11T17:57:54.747 回答