How can I increase the photo shooting speed in Camerax?

Skip to first unread message

Ahmet Birdevrim

Nov 22, 2023, 9:07:17 AM11/22/23
to Android CameraX Discussion Group
My goal is to be able to take pictures in quick succession. For this;


takePicture(outPut, cameraTakePictureExecutor, object : ImageCapture.OnImageSavedCallback { 
override fun onImageSaved(outputFileResults: ImageCapture.OutputFileResults) {
Log.d("Capture", "Complete") } 
override fun onError(exception: ImageCaptureException) { } })

However, the onImageSaved response in the OnImageSavedCallback listener of the takePicture method does not come fast enough.

When I use ImageCapture.CAPTURE_MODE_ZERO_SHUTTER_LAG instead of ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY, the preview freezes after a while.

Is there a best practice you recommend that I can shoot faster? 

Nov 23, 2023, 12:08:17 AM11/23/23
to Android CameraX Discussion Group, Ahmet Birdevrim
Thanks for the question. May we know what's the reason you want it faster? It takes more time for onImageSaved to return since it requires IO operations. Use OnImageCapturedCallback to receive the image in memory.

The frozen preview when using ZSL may be a different issue. What device did you test on?

Ahmet Birdevrim

Nov 23, 2023, 3:17:10 AM11/23/23
to Android CameraX Discussion Group,, Ahmet Birdevrim

Thank you for your quick response. One of the reasons why I need to be able to take photos faster. For cases where the frames I want to photograph, such as a runner, a car race, are taken in quick succession.

I am using Samsung S21 Ultra as a test phone in these developments.


23 Kasım 2023 Perşembe tarihinde saat 08:08:17 UTC+3 itibarıyla şunları yazdı:
Reply all
Reply to author
0 new messages