android-camera2-secret-picture-taker icon indicating copy to clipboard operation
android-camera2-secret-picture-taker copied to clipboard

Pictures are very dark

Open rutvik106 opened this issue 6 years ago • 9 comments

Pictures captured are very dark and sometimes completely black.

rutvik106 avatar Aug 12 '17 12:08 rutvik106

Try to increase the delay used after opening the camera and before starting the capture.

hzitoun avatar Aug 13 '17 09:08 hzitoun

Increasing the delay does not solves the issue (tried 5s, 10s..). I also having the same problem with my Moto G5. Maybe this https://stackoverflow.com/questions/31925769/pictures-with-camera2-api-are-really-dark could help.

danilobertelli avatar Oct 11 '17 13:10 danilobertelli

I am also facing the "Very dark pictures" bug, I tried to increase the delay but it didn't help.

AantonM avatar Feb 08 '18 00:02 AantonM

I increase delay and still dark !!!

fukhaos avatar Jun 14 '18 18:06 fukhaos

Same here. Image is too dark.

Qamar4P avatar Oct 10 '18 11:10 Qamar4P

Same here, Huawei P10 and image is dark

dzboot02 avatar Oct 16 '18 14:10 dzboot02

I just put session.setRepeatingRequest(captureBuilder.build(), null, null); before session.capture(captureBuilder.build(), captureListener, null); and it works. But I am not sure if that's the right place to make the setRepeatingRequest.

  cameraDevice.createCaptureSession(outputSurfaces, new CameraCaptureSession.StateCallback() {
                    @Override
                    public void onConfigured(@NonNull CameraCaptureSession session) {
                        try {
                            session.setRepeatingRequest(captureBuilder.build(), null, null);
                            session.capture(captureBuilder.build(), captureListener, null);        
                        } catch (final CameraAccessException e) {
                            Log.e(TAG, " exception occurred while accessing " + currentCameraId, e);
                        }
                    }

                    @Override
                    public void onConfigureFailed(@NonNull CameraCaptureSession session) {
                    }
                }

androidnoob123 avatar Oct 23 '18 18:10 androidnoob123

Hi, this library here works, please refer to it: https://github.com/OmarAflak/Android-Camera2-Library/blob/master/ezcam/src/main/java/me/aflak/ezcam/EZCam.java. Read the readme for implementation on MainActivity. You can create a background service by using a dummy texture view (see closed issue there) and use it without any preview. It results in good pictures with appropriate amount of lighting.

androidnoob123 avatar Oct 26 '18 03:10 androidnoob123

Hi, did anyone managed to find a solution to this problem yet?

jonneymendoza avatar May 18 '21 09:05 jonneymendoza