Friday, 15 July 2022

WebRTC - Selecting the main camera in a webapp (when the device has multiple back cameras)

Trying to create a web app that captures images from the browser from the back camera, and struggling to locate the main camera in a multi-camera device.

The problem we are facing is that every manufacturer has different naming conventions, and the order of the cameras in the list is not indicative of which camera is the main camera (the one that doesn't have anything special, like wide-angle, or telephoto, periscope, ...) which has the highest resolution.

When using this website: https://webrtc.github.io/samples/src/content/devices/input-output/ for my device, for example, the main camera can be located by selecting either camera 2 2 or camera 2 0: Camera 2 2 and Camera 2 0

Is there any way to locate the main camera using javascript? or at least get camera characteristics programmatically to select the right one?



from WebRTC - Selecting the main camera in a webapp (when the device has multiple back cameras)

No comments:

Post a Comment