Flutter CameraPreview is blurry, noisy, and zoomed in

Viewed 769

I have a Google Pixel 3 and am using Flutter's camera plugin at version 0.8.1.

CameraPreview is blurry, noisy, zoomed in, and generally looks worse than Android's camera app.

Android Camera App: enter image description here

Flutter CameraPreview: enter image description here

This is how I'm instantiating the CameraController:

final cameras = await availableCameras();
final controller = CameraController(
  cameras[0],
  ResolutionPreset.veryHigh,
  enableAudio: false,
  imageFormatGroup: ImageFormatGroup.yuv420,
);

I tried all 4 cameras:

  • Camera 0 is on the front and is the one in question
  • Camera 1-3 is on the back and they are all the same. Their quality is similar to Android's Camera App.

Anyone run into this issue?

1 Answers

try using the image_picker plugin, you can adjust the image quality and resolution easily.

void pickImage() async {
    var image = await ImagePicker().getImage(
      source: ImageSource.camera,
      preferredCameraDevice: CameraDevice.front,
      imageQuality: 100,
      maxWidth: 5000,
      maxHeight: 5000,
    );
    setState(() {
      _image = File(image.path);
      print(_image);
    });
  }
Related