Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pictures are very dark #10

Open
rutvik106 opened this issue Aug 12, 2017 · 9 comments
Open

Pictures are very dark #10

rutvik106 opened this issue Aug 12, 2017 · 9 comments

Comments

@rutvik106
Copy link

rutvik106 commented Aug 12, 2017

Pictures captured are very dark and sometimes completely black.

@hzitoun
Copy link
Owner

hzitoun commented Aug 13, 2017

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

@danilobertelli
Copy link

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.

@AantonM
Copy link

AantonM commented Feb 8, 2018

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

@fukhaos
Copy link

fukhaos commented Jun 14, 2018

I increase delay and still dark !!!

@Qamar4P
Copy link

Qamar4P commented Oct 10, 2018

Same here. Image is too dark.

@hiddeneyes02
Copy link

Same here, Huawei P10 and image is dark

@androidnoob123
Copy link

androidnoob123 commented Oct 23, 2018

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
Copy link

androidnoob123 commented Oct 26, 2018

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.

@jonneymendoza
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants