Repository navigation
Description
Use case
I am trying to use a live preview to detect certain points in real-time in an image stream and overlay them on the preview. This means that the resolution of the streaming images needs to be relatively low.
When the user hits "take photo", a best quality picture should be recorded. This should use any in-device processing etc available (eg HDR+, max native resolution etc) to create the best possible jpg on the file system.
Currently, if I set ResolutionPreset to max, the streaming images AND the takePicture will be affected. This means that I have to
- stop image stream
- stop and dispose the current controller
- handle the preview stopping visually
- create a new controller with high resolution
- execute takePicture
- stop and dispose the high-res controller
- create a new low-res controller
- start the preview again
- start image stream
This results in a bad user experience as it takes a long time, and convoluted code.
Proposal
It would be good to be able to specify a resolution/quality to takePicture, startImageStream and the CameraPreview independently. As a first thing a simpler quality option to the takePicture function would already be ok. Or just change the default for takePicture to max or similar, as its not going to be used for real-time stuff anyway if its via the file system.
Activity
josealb commentedon Dec 9, 2019
@cputoaster could you share more details on how you call takePicture without stopping the stream?
I need to stop the stream altogether before calling takePicture, or I get an exception
Unhandled Exception: CameraException(error, CaptureRequest contains unconfigured Input/Output Surface!)Also, I second your request, I want to take pictures when I see a specific object on the screen, the preview needs to be lower quality but the images would preferably be at max resolution
cputoaster commentedon Dec 9, 2019
@josealb I have to stop the stream too now if I want to call takePicture. That being said, it's not that bad for taking a single picture. It does stutter and is certainly not optimal, but it works for low res pics. But it does not solve the described problem of low res image stream and high-quality picture.
Limit camera preview size. This is related to the issue, flutter/flut…