How to select a camera when there are multiple back cameras.

571 views
Skip to first unread message
Assigned to tonyt...@google.com by eri...@google.com

user

unread,
Oct 10, 2021, 7:35:13 PM10/10/21
to Android CameraX Discussion Group

Does anyone know how to select a camera when there are multiple Back cameras?

I looked at the Multi-camera API page and could not figure out how to do it.

If there are 3 or 4 back cameras, can you give me the code for KOTLIN to select those cameras and show the preview? Thanks in advance.

tonyt...@google.com

unread,
Oct 18, 2021, 5:27:11 AM10/18/21
to Android CameraX Discussion Group, user
Hi,
Are you using CameraX or Camera2? Do you want to select a camera based on its ID or other criteria like FOV?

For the devices that support logical camera (as described in https://developer.android.com/training/camera2/multi-camera), CameraX has CameraControl#setZoomRatio that automatically switches between the cameras with different FOV.

Reply all
Reply to author
Forward
0 new messages