Search code examples
fluttercameraresolution

Flutter - control camera resolution


Is there a way to "force" phone camera to take a picture with full HD resolution 1920x1080 instead of default 3420x4032 ?


Solution

  • If you use camera package, you can set the resolution using ResolutionPreset, see possible values here.

    In your case define a CameraController after getting available cameras like this (assuming there is a camera available and you want to use the first one):

    final cameras = await availableCameras();
    final controller = CameraController(cameras[0], ResolutionPreset.veryHigh);
    final preview = CameraPreview(controller);
    

    This is a simple example, in a real world app you need to keep track of the controller and dispose it properly.