Skip to content

[camera] allow different resolution for takePicture and imageStream #46082

@cputoaster

Description

@cputoaster

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.p: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions