Flutter CameraPreview is blurry, noisy, and zoomed in
Asked Answered
T

1

9

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?

Tilford answered 3/5, 2021 at 0:58 Comment(4)
Experiencing the same issue. Made any progress resolving this?Beerbohm
Did you ever fix this?Simplicity
Woof, still no fix? This seems like it may possibly be caused by an incorrect aspect ratio. OP, did you still have the same issue after the pictures were taken?Luckin
I have the same problem. Camera plugin doesn't allow to take a photo normally because it take too much time to focus (several seconds), and image stream makes photo blurry even in preview mode.Horvath
C
-2

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);
    });
  }
Chrystalchryste answered 3/5, 2021 at 2:52 Comment(1)
That won't work. I'm looking to show the camera feed in a widget.Tilford

© 2022 - 2024 — McMap. All rights reserved.