I'm developing an app that would benefit from providing users with options for their camera resolution, particularly focusing on 4:3 aspect ratios. A user reached out to me saying they couldn't access all their available resolutions on their Dell Webcam WB7022, which supports 4K. After checking their getCapabilities() data, everything looked okay, except the resolution values were peculiar: the width showed a maximum of 1080 and the height a maximum of 1920, which seems incorrect. Has anyone else encountered this issue? Should I consider avoiding getCapabilities altogether? For now, I've decided to display all resolutions and let users choose.
2 Answers
It seems like you're assuming the camera is set up in landscape mode, but it could actually be in portrait. If your app only handles landscape values, it might be a simple fix to check and swap those width and height values.
While getCapabilities() is generally dependable for getting camera specs, it isn't flawless for all devices or browsers. Sometimes cameras like the Dell Webcam might report limited resolutions due to specifications, firmware, or driver issues. Since you've noted this issue seems specific to that model, it could relate to how that particular device interacts with the browser's media APIs. Your approach of allowing users to select from all available resolutions is a solid temporary fix. If you aim for more precision, you might want to try using getSettings() after starting the stream to confirm the actual resolution. Ultimately, it's okay to lean on getCapabilities(), but always have a backup plan, especially when dealing with a variety of devices.

I initially thought about that too, but since it's a webcam, I'm puzzled as to why they would design it with a portrait orientation. Nevertheless, Dell claims the camera can go up to 4K, which doesn’t match these reported values.