FFmpeg dshow device format list

user1722669 picture user1722669 · Sep 27, 2017 · Viewed 8.7k times · Source

I would like to ask is there any option for getting dshow device format list on Windows.

For example on Linux I am able to get device format list on Linux via

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

On Windows, I am able to get device list

ffmpeg -list_devices true -f dshow -i dummy

and device options

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

But I am not able to get format list, like on Linux via v4l2.

How can I get supported format list for dshow device via FFmpeg on Windows?

Answer

joaopaulo.ps93 picture joaopaulo.ps93 · May 11, 2020

A delayed answer to your question.

It is not possible to clearly understand what you mean by "format list", but if you refer to the Pixel Format that appears when using v4l2, then you can get this data from the output of the -list_options command that you mentioned.

On my laptop, for example, I have the following output when running ffmpeg -f dshow -list_options true -i video ="Integrated Webcam":

(omitting the first lines for easy viewing)

[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

As you can see, the data contained in the vcodec and pixel_format keys are the same values that you would find in v4l2's Pixel Format, in this case mjpeg and yuyv422, respectively.

If what you want is an output with the same text formatting as v4l2, then I understand that this can be addressed with regular expressions, for example, and it is not directly related to FFmpeg.