Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Camera bad quality

i got the Flutter Camera working with a preview and all that. But the quality of the recorded video is way to bad. I get 1MB for 10 seconds. The resolution is fine (1080 x 1440), but i think the bitrate is way to low somehow.

I looked into the CameraPlugin: https://github.com/flutter/plugins/blob/master/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

 mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
 mediaRecorder.setVideoEncodingBitRate(1024 * 1000);
 mediaRecorder.setAudioSamplingRate(16000);

Is this the normal configuration and does it work for you guys? I got a Oneplus 2 and normal camera is taking better videos.

I'm not used to the flutter Method Channel so i can't create my own CustomCameraPlugin and change the important values.

Maybe there is a whole different approach. Let me know

Greetings Markus

like image 852
Markus Avatar asked Apr 29 '26 11:04

Markus


1 Answers

Changing mediaRecorder.setVideoEncodingBitRate from 1024 * 1000 to 3000000 for worked for me for better quality.

https://github.com/flutter/plugins/blob/master/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

like image 151
divyanshu bhargava Avatar answered May 02 '26 05:05

divyanshu bhargava



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!