camera-samples icon indicating copy to clipboard operation
camera-samples copied to clipboard

Use VideoCapture, ImageAnalysis and Preview use cases at the same time on CameraX

Open Perick95 opened this issue 4 years ago • 3 comments

I've already implemented the preview, video capture and image analysis use cases for cameraX and everything works fine, I can visualize the preview, record a video or do image analysis. The problem is when I try to combine all the use cases to work together I have the error Id : 1. May be attempting to bind too many use cases. This probably because videoCapture is not already supported in cameraX.

Is there a way to make the 3 use cases work simultaneously?

Thanks in advance.

Perick95 avatar Sep 03 '21 14:09 Perick95

UseCaseGroup

songyating avatar Jan 10 '22 02:01 songyating

For example, Val usecasegroup = usecasegroup Builder() .addUseCase(preview) .addUseCase(videoCapture) .addUseCase(imageCapture!!) .setViewPort(viewPort) .build() val camera = cameraProvider. bindToLifecycle(this, cameraSelector, useCaseGroup)

songyating avatar Jan 10 '22 02:01 songyating

It's not same time,useCase is independent.

whereareu avatar Jul 20 '23 08:07 whereareu