How can I shoot wide-angle on Redmi Note 11 Pro and Similar devices?

81 views
Skip to first unread message

Ahmet Sina Birdevrim

unread,
Aug 24, 2023, 4:21:24 AM8/24/23
to Android CameraX Discussion Group
Hello,

I'm looking for the lowest one by comparing the focalLengths values in the logical camera ids to get the wide-angle shot. However, on devices like the Redmi Note 11 Pro, the logical camare id returns one. How can I provide wide-angle shooting in such situations?

What's the best approach to shooting wide-angle?

Thanks

tonyt...@google.com

unread,
Aug 24, 2023, 4:54:49 AM8/24/23
to Android CameraX Discussion Group, a.sinab...@gmail.com
You may query the intrinsic zoom ratio of all cameras by using CameraProvider.getAvailableCameraInfos, then obtain the camera selector corresponding to the wide-angle (the one that has intrinsic zoom ratio smaller than 1.0)

CameraSelector wideAngleCameraSelector = null;
List<CameraInfo> allCameraInfos = cameraProvider.getAvailableCameraInfos();
for (CameraInfo cameraInfo : allCameraInfos) {
    float ratio = cameraInfo.getIntrinsicZoomRatio();
    if (ratio < 1) {
        wideAngleCameraSelector = cameraInfo.getCameraSelector();
        break;
    }
}

if (wideAngleCameraSelector != null) {
    cameraProvider.bindToLifecycle(lifecycleOwner, wideAngleCameraSelector, useCase);

Ahmet Sina Birdevrim

unread,
Sep 1, 2023, 2:52:38 AM9/1/23
to Android CameraX Discussion Group, tonyt...@google.com, Ahmet Sina Birdevrim
Hi,

Thanks, I tried this method, I was able to get wide angle feature on devices like Samsung s21. But on Redmi Note 11 Pro, CameraProvider.getAvailableCameraInfos() does not give wide angle information. As far as I understand, it is due to the manufacturer's failure to provide this information.

Thanks.
24 Ağustos 2023 Perşembe tarihinde saat 11:54:49 UTC+3 itibarıyla tonyt...@google.com şunları yazdı:
Reply all
Reply to author
Forward
0 new messages