-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
Range<Integer>[] fpsRanges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); | ||
|
||
if(fpsRanges.length > 0) { | ||
aeFPSRange = fpsRanges[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes the first returned range the "best"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the slowest FPS off the list, and from what I recall when attempting to fix this issue in my app was that the slowest FPS = better auto exposure result of the preview image. That and the fact that the stock camera app on the device is the same FPS I followed suit.
The range values can come in two different varieties:
- (x,x) Where the FPS ranges are the same (I get 3 of these in that list on my device (7,7), (14,14) and (30,30))
- (x, y) Where there is an allowed leeway for the FPS. But from what I recall when trying to fix this issue in my own project led to sporadic behaviour such as the preview image flicking between dark / normal exposure.
I can take a look again tonight and see if including one of the (x,y) ranges that has the largest range between the x and y component to see if this would produce a better overall frame-rate of the preview but all the while keeping the resulting auto exposure values sane?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to add, on newer/high end devices, the first value off that list of ranges is actually quite high. For example, I tested my app on my sisters Huawei p20 pro and the frame-rate was smooth and great exposure settings.
5 other people beta tested my app for Android and none of whom queried slow performance of the camera preview / dark images.
Granted this isn't a huge pool of people, but it does indicate that I improved my in app camera a lot this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @NickCullen i have tried your code it solved the problem but when the camera start recording the screen zoom in and become dark again and after the recording is done it zoom outs and become light again. And the file also saved as dark recorded. Please help me out here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jatinmadaan8 I made a comment a few minutes ago HERE about using continuous picture mode to use AE and AF settings from the preview. Could you give that a try?
As a side note though I notice you are talking about video here, I have no experience with the video side of things I'm afraid, I can only hope that this will resolve your issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @NickCullen i tried it today still no progress. I don't know for no reason when the recording starts it gets zoom and dark.
@amirh I have just had some time to check out the biggest FPS range and it works really well (I was in the middle of developing my camera when I saw the flickering darkness so it must of been something else that caused it). I took some pictures of my device's screen (which unfortunately I can't upload here) when I ran them in 4 different modes:
Please note I've added myself to the authors files, as per the contributing notes. |
Hi thanks for following up. |
Hi @amirh If we were to make it a configurable option in the camera controller, would the setting be miss-leading on an iOS device? Or will a simple statement in the comments stating that the option only effects Android devices be sufficient? |
It should be ok to have features that are supported only on some platforms/devices, otherwise we would be limiting ourselves to a lowest common denominator. Also note that we are prioritizing quality over new features right now so it might take time for a PR adding this new feature to be merged. |
A camera not usable on lots of Android devices because being too dark is not quality. |
Hi! |
@NickCullen Do you see any possibility to merge your changes in the new federated architecture and expose an option to configure this behaviour via the Dart implementation? |
This has been solved by PR #3383 and has been released in version 0.6.4+3. I will therefore be closing this PR. |
how do I take a picture and save it into cloud firestore |
Fixed camera preview darkness (my test device is a Samsung Galaxy Tab A).
The issue was that the FPS of the preview camera was too high and the auto exposure capability couldn't keep up which resulted in it 'giving up'. This only seems to be an issue on low end devices such as this and I've noticed the level of darkness varies between devices.
PLEASE NOTE: On low end devices (such as the Samsung Galaxy Tab A) this does make the camera preview feel choppy (after all... the frame rate had to be reduced). If I open the stock camera app on this device, the frame rate is identical. Meaning that they're also compensating FPS for exposure gains (so you can actually see what you're about to take a photo of).