Moonware / cordova-cameraserver

Cordova Plugin (iOS + Android) serving Live Images from the Camera over HTTP
43 stars 34 forks source link

Camera too dark on android #3

Open bassemBMI opened 9 years ago

bassemBMI commented 9 years ago

I liked this plugin, but I have an issue with the brightness, the image is too dark, I tried to adjust this by using setBrightness function, the brightness value changed but not the image. Also the setVideoFormat and getVideoFormats return false. Any idea to fix this ?

w3t commented 9 years ago

What device do you use? There way cameramanager behaves is pretty different from a device to the other.

The first few frames are dark on some devices because it's the first frame after initializing the camera and it may be required to pull a few frames so that the camera has time to adjust brightness automatically (after a few seconds it will go back to sleep).

You can try playing with setExposureCompensation(float)

Commenting the parameters.set("metering-areas", "(-200,-10,200,50,1)"); may also have effect since it tells the cameramanager which area to consider to adapt the picture but some devices don't like this.

bassemBMI commented 9 years ago

Thanks you for response, I m using Nexus 5 - Android 6.0, I will try tonight the setExposureCompensation() function and playing with the "metering-areas" option.

w3t commented 9 years ago

Strange Nexus 5 is part of the device that I use too and should work fine.

I think it's more related to the symptom of first frames are dark during the initialisation of the camera. Just try to pull a 5-10 frames and then it should adjust.