Can't select all cameras

76 views
Skip to first unread message
Assigned to tonyt...@google.com by wuj...@google.com

Yan Ke

unread,
Jan 17, 2023, 3:38:24 PM1/17/23
to Android CameraX Discussion Group
Two related problems on selecting different cameras and setting the zoom.

1) I can't see all cameras on all phones.  On the Samsung S21, I can see two of the three back cameras (ultra-wide and wide), and can't see the telephoto.  On other phones, I can only see the default camera.

2) When I try to set the zoom, it only zooms in using the selected camera.  I would expect that it would select to the most appropriate camera depending on the zoom setting.

tonyt...@google.com

unread,
Jan 18, 2023, 3:03:53 AM1/18/23
to Android CameraX Discussion Group, y...@yanke.org
Thanks for the questions!

1) What do you mean by "seeing all cameras"? Which method are you using to get the camera information? Is it CameraManager#getCameraIdList or ProcessCameraProvider.getAvailableCameraInfos?

2) IIRC, S21 doesn't support logical camera architecture, which is required to let setting of zoom ratio to be able to switch in between different lenses. You may refer to this post for a workaround to switch to a desired lens.

Yan Ke

unread,
Jan 19, 2023, 12:47:14 AM1/19/23
to tonyt...@google.com, Android CameraX Discussion Group
1) I am using CameraSelector.Builder().addCameraFilter { cameraInfos -> ... }
2) If I am able to select the right camera using #1, then I don't necessarily need to set the zoom.

tonyt...@google.com

unread,
Jan 19, 2023, 7:03:14 AM1/19/23
to Android CameraX Discussion Group, y...@yanke.org, Android CameraX Discussion Group, tonyt...@google.com
Thanks for the reply. Could you help to check if the telephoto camera is contained in CameraManager#getCameraIdList? You may use CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS or simply check how many LENS_FACING_BACK cameras are there. Supposedly the telephoto camera is hidden by Samsung so that CameraX can't provide it in the camera selector as well. However let us know if it's in getCameraIdList cause that probably says a bug.

Yan Ke

unread,
Jan 21, 2023, 1:36:30 AM1/21/23
to tonyt...@google.com, Android CameraX Discussion Group
These are the camera characteristics returned.

Camera ID 0: facing 1, focal length 5.4
Camera ID 1: facing 0, focal length 3.3
Camera ID 2: facing 1, focal length 2.2
Camera ID 3: facing 0, focal length 3.3

I suppose either camera ID 1 or 3 is supposed to be the telephoto camera, but they're duplicated front cameras.

Does this mean there is no way to get the telephoto camera?

tonyt...@google.com

unread,
Jan 21, 2023, 2:56:46 AM1/21/23
to Android CameraX Discussion Group, y...@yanke.org, Android CameraX Discussion Group, tonyt...@google.com
I'm afraid no... Camera ID 1 is usually the default front camera, while others are really depending on how the OEM implements it, especially for older devices. On the S21 list, looks like there's no back lens that is narrower (larger focal length) than the default back camera (ID 0).
Reply all
Reply to author
Forward
0 new messages