Hello,
I am facing a similar problem (https://stackoverflow.com/questions/70706754/camerax-video-recording-freezes-and-generates-empty-video-file/71356133#71356133)
for capturing photo. I am trying to take multiple photos using our app. Preview
and taking the first photo is always fine. But when I try to take a second or third
photo, camera stops taking photos.
Log is attached here. Thanks in advance.
imageCapture.takePicture(image, ContextCompat.getMainExecutor(this),
new ImageCapture.OnImageSavedCallback() {
@Override
public void onImageSaved(@NonNull ImageCapture.OutputFileResults outputFileResults) {
runOnUiThread(() -> {
onPictureTakenOption(photoFilePath);
});
}
@Override
public void onError(@NonNull ImageCaptureException exception) {
}
}
);
03-04 13:24:44.454 8506 10413 W System : A resource failed to call release.03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: RuntimeException while executing runnable CallbackListener,androidx.camera.core.ProcessingImageReader$3@4a46dae with executor java.util.concurrent.ThreadPoolExecutor@601e74f[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4]03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: java.util.concurrent.RejectedExecutionException: Task CallbackListener,androidx.camera.core.ProcessingImageReader$3@4a46dae rejected from java.util.concurrent.ThreadPoolExecutor@601e74f[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4]03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at androidx.concurrent.futures.AbstractResolvableFuture.executeListener(AbstractResolvableFuture.java:1053)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at androidx.concurrent.futures.AbstractResolvableFuture.complete(AbstractResolvableFuture.java:902)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at androidx.concurrent.futures.AbstractResolvableFuture.setException(AbstractResolvableFuture.java:712)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at androidx.concurrent.futures.CallbackToFutureAdapter$SafeFuture.setException(CallbackToFutureAdapter.java:184)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at androidx.concurrent.futures.CallbackToFutureAdapter$Completer.finalize(CallbackToFutureAdapter.java:337)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.lang.Daemons$Daemon.run(Daemons.java:139)03-04 13:24:44.457 8506 10413 E bstractResolvableFuture: at java.lang.Thread.run(Thread.java:923)
--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/CAHDOb3n0dY-E2Esrf_5GPSZRqbNP8qUt4LffQ7-uXuvtgC2aRg%40mail.gmail.com.
1. Could you provide the model number (SM-XXXX) of the devices which you can reproduce the issue? Samsung S10+ (SM-G975U1) and A71 5G (SM-A716V)
2. What is the issue occurrence rate? – The occurrence rate is very high (one per 2-3 events).
3. Are there any reproduce steps that is easier to reproduce the issue? – In our app(I have attached one screenshot of our app) we need to take multiple photos. This issue is only happening for either the second or third capture, not the first capture.
4. Is it possible to provide a sample project with the source code to reproduce the issue? Or, could you help to check whether the issue can be reproduced by enabling NIGHT mode in the CameraXBasic sample app? – I checked with CameraXBasic sample app which is working fine. I have attached a java file from my project where I have implemented image capture.
NB:
I have tested our app with the CameraX vendor extension not supported devices(Pixel 4a and
other devices) where I didn’t face this issue(not a single time).
Thanks
Mohamamd
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/8610b863-a3b5-4b8d-94bd-692024d92df0n%40android.com.