Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

0.5 minzoom on CameraX

239 views
Skip to first unread message

dorra kadri

unread,
Jan 8, 2025, 9:05:37 AMJan 8
to Android CameraX Discussion Group

I've been working on an app that has CameraX implemented in a JavaScript application, and we're experiencing an issue with the minimum zoom levels. On one device, the minimum zoom is set to 0.6, and the app correctly provides this value. However, on another device, the minimum zoom is 0.5, but the app returns a value of 1 instead.

I've tested multiple devices that support a 0.5 minimum zoom, and it seems there's a problem with the lens or switching cameras on these devices. I've explored many conversations on this subject and found that others have encountered similar issues, but there hasn't been a comprehensive discussion or explanation.

If someone knows why this is happening—whether it's a problem with the APIs provided by the device itself or another underlying issue—I would greatly appreciate any insights. I'm curious about why a camera with a 0.5 minimum zoom causes this problem. Any documentation or information on this topic is welcome.

Thank you!

Scott Nien

unread,
Jan 9, 2025, 10:55:08 AMJan 9
to dorra kadri, Android CameraX Discussion Group
 However, on another device, the minimum zoom is 0.5, but the app returns a value of 1 instead.

Thanks for reporting the issue. To investigate it further, can you give us more information regarding 
1) How do you find out the minimum zoom is 0.5 ?  Is it via the CameraX API  cameraControl.getZoomState or anything else ?
2) Where does the app return a value of 1 instead ?   What API are you invoking ?
3) If possible,  give us some model name that has the issue.  

Thanks!  

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/7e921763-c69d-4e82-b4a8-2f54ec81f2c2n%40android.com.

Yannick Le sombre

unread,
Jan 12, 2025, 6:35:09 PMJan 12
to Scott Nien, dorra kadri, Android CameraX Discussion Group

Scott Nien

unread,
Jan 12, 2025, 10:00:57 PMJan 12
to Android CameraX Discussion Group, yannick...@gmail.com, kadri...@gmail.com, Android CameraX Discussion Group, Scott Nien
I think you are probably checking the 0.5 min zoom from device's built-in camera app.   

To clarify ,  some devices support Android Multi-Camera APIs to expose their extra wide or telephotos lens and some devices don't 
For devices that support Android Multi-Camera APIs (which most latest high-end devices support it), 
      the minimal zoom in CameraX will be able to reflect the ultra wide (if it exists) and apps can set the zoom ratio to like 0.5 or 0.6 to switch to ultra wide lens. 
For devices that don't support Android Multi-Camera APIs and the ultra wide lens is exposed as a public camera Id
    the minimal zoom will still be 1.0 even though ultra wide lens exists.  You can use ProcessCameraProvider#getAvailableCameraInfos() to get all the cameraInfos and then query  CameraInfo#getIntrinsicZoomRatio() API to tell if it is ultra wide or not, and then call bindToLifecycle to do the switch.   See the code snippets below: 
   
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);


Please note that there some some devices that don't expose their ultra wide lens in public camera ids. CameraX is unable to allow apps to use the ultra wide lens in this case. 

   

dorra kadri

unread,
Jan 16, 2025, 4:23:57 AMJan 16
to Android CameraX Discussion Group, scot...@google.com, yannick...@gmail.com, dorra kadri, Android CameraX Discussion Group
thanks for the reply its clear now 
Reply all
Reply to author
Forward
0 new messages