Gili
Gili

Reputation: 90091

How to query a webcam's output formats?

How do I query a webcam's output capabilities (e.g. resolution, fps, codec) under Windows? I am okay doing this either programmatic or using a standalone application.

Upvotes: 3

Views: 5236

Answers (2)

Sz.
Sz.

Reputation: 3634

A great standalone (cross-platform, command-line) tool for this is e.g. ffmpeg, the Swiss army knife of video streaming:

ffmpeg -list_devices true -f dshow -i dummy gives you the device list.

Then, for a device name your see listed (e.g. "USB 2.0 WebCamera"):

ffmpeg -list_options true -f dshow -i video="USB 2.0 WebCamera"

Upvotes: 8

Roman Ryltsov
Roman Ryltsov

Reputation: 69706

Using DirectShow API you enumerate capabilities and media types on the camera filter output pin. This covers resolutions and pixel formats (codecs). This normally does not cover frame rates that might be additionally available via IAMVideoControl::GetFrameRateList.

See also:

Upvotes: 1

Related Questions