How can I increase the photo shooting speed in Camerax?

91 views
Skip to first unread message

Ahmet Birdevrim

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

ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
.build()

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? 
Thanks

tonyt...@google.com

unread,
Nov 23, 2023, 12:08:17 AM11/23/23
to Android CameraX Discussion Group, Ahmet Birdevrim
Hi,
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

unread,
Nov 23, 2023, 3:17:10 AM11/23/23
to Android CameraX Discussion Group, tonyt...@google.com, Ahmet Birdevrim
Hi,

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.

Thanks.


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