Scene mode in CameraX?

100 views
Skip to first unread message

Tomáš Válek

unread,
Nov 7, 2020, 3:13:13 PM11/7/20
to Android CameraX Discussion Group

Goal is use scene mode for preview and image capture. Something like Camera2 scene mode

I tried it with snow scene, because snow is recognizable via Camera2Interop:

val previewBuilder = Preview.Builder()
val camera2InterOp = Camera2Interop.Extender(previewBuilder)
camera2InterOp.setCaptureRequestOption(CaptureRequest.CONTROL_SCENE_MODE, CaptureRequest.CONTROL_SCENE_MODE_SNOW)
previewUseCase = previewBuilder.build()

but it doesn't seem to work. I tried it with Camera1 API and it works.

Gradle dependencies:
androidx.camera:camera-core:1.0.0-beta11
androidx.camera:camera-camera2:1.0.0-beta11
androidx.camera:camera-lifecycle:1.0.0-beta11
androidx.camera:camera-view:1.0.0-alpha18
androidx.camera:camera-extensions:1.0.0-alpha18

Does anyone know how to solve this? Thank you.

Vinit Modi

unread,
Nov 7, 2020, 5:15:58 PM11/7/20
to Tomáš Válek, Android CameraX Discussion Group
May I know what are you trying to achieve with the scene modes and which devices you've tried? Unfortunately, the scene modes aren't well supported across all the Android devices. 


--
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 on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/7f16ec6f-ac6a-4e77-bcf7-c4b825d9b31cn%40android.com.

Tomáš Válek

unread,
Nov 8, 2020, 6:57:54 AM11/8/20
to Android CameraX Discussion Group, Vinit Modi, Android CameraX Discussion Group
May I know what are you trying to achieve with the scene modes and which devices you've tried?
I probably do not understand well, I want to try achieve change scene mode: night, portrait, landscape, auto, etc.
I have tried with: Pixel 2 Android 10, Xiaomi Redmi Note 8T Android 9, Huawei Nova 3 Android 9, Nexus 5 Android 7, Nexus 5X Android 8. I have tried scene modes with Camera1 API and it works on these devices.

Dne sobota 7. listopadu 2020 v 23:15:58 UTC+1 uživatel Vinit Modi napsal:

Eino-Ville Talvala

unread,
Nov 8, 2020, 6:38:44 PM11/8/20
to Tomáš Válek, Android CameraX Discussion Group, Vinit Modi
While this may not resolve your issue by itself, you need to also set CaptureRequest.CONTROL_MODE to USE_SCENE_MODE.  Otherwise CONTROL_SCENE_MODE is ignored.

However, don't expect these scene modes to provide equivalent functionality to the default camera app's night mode, and similar.  They tend to be far more limited.
Use CameraX extensions when possible for a closer match.




Tomáš Válek

unread,
Nov 10, 2020, 11:43:56 AM11/10/20
to Android CameraX Discussion Group, Eino-Ville Talvala, Android CameraX Discussion Group, Vinit Modi
Thank you. CaptureRequest.CONTROL_MODE_USE_SCENE_MODE works.
I tried Night mode via NightPreviewExtender, but none of my devices (Pixel 2 Android 10, Xiaomi Redmi Note 8T Android 10, Huawei Nova 3 Android 9, Nexus 5 Android 7, Nexus 5X Android 8) supported it (isExtensionAvailable returns false).

Dne pondělí 9. listopadu 2020 v 0:38:44 UTC+1 uživatel Eino-Ville Talvala napsal:

Vinit Modi

unread,
Nov 10, 2020, 11:55:31 AM11/10/20
to Tomáš Válek, Android CameraX Discussion Group, Eino-Ville Talvala
Hi Tomáš,

Extensions are available only on Android Q and newer devices from select OEMs. Please try Motorola Q devices or one of the Samsung devices mentioned below:

Q OS - These have extension support

Galaxy-A51, Galaxy-A51 5G

Galaxy-A71, Galaxy-A71 5G

Galaxy-M41

Galaxy-A80

Galaxy-S10Lite

Galaxy-Note10-Lite

Galaxy-S20-FE-5G

W21

Galaxy-S10e, Galaxy-S10, Galaxy-S10+, Galaxy-S10 5G

Galaxy-Z-Flip, Galaxy-Z-Flip 5G

Galaxy-Note10, Galaxy-Note10 5G, Galaxy-Note10+, Galaxy-Note10+5G

Galaxy-S20 5G, Galaxy-S20+ 5G , Galaxy-S20 Ultra 5G 

Galaxy-Note20 5G, Galaxy-Note20 Ultra 5G

Galaxy-Z-Fold2 5G


Thanks!
Vinit
Reply all
Reply to author
Forward
0 new messages