Is it possible to combine Preview, ImageAnalysis, and VideoCapture with CameraX?

雨燕双飞 提交于 2020-05-15 08:00:26

问题


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?

来源:https://stackoverflow.com/questions/61524671/is-it-possible-to-combine-preview-imageanalysis-and-videocapture-with-camerax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!