Is it possible to bind Preview
, ImageAnalysis
, and VideoCapture
at the same time? Combined in pairs, all possible combinations (ie. Preview
+ImageAnalysis
, Preview
+VideoCapture
, and ImageAnalysis
+VideoCapture
) work perfectly fine but binding all three together throws the following exception.
java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 1. May be attempting to bind too many use cases.
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions(Camera2DeviceSurfaceManager.java:193)
at androidx.camera.core.CameraX.calculateSuggestedResolutions(CameraX.java:943)
at androidx.camera.core.CameraX.bindToLifecycle(CameraX.java:293)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:229)
Is there any workaround that allows me to use ImageAnalysis
and at the same time record a video?