3

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

Markus
  • 449
  • 1
  • 7
  • 22
  • Sorry if I'm misunderstanding. Are you setting camera resolution to high? like so `new CameraController(_cameraDescriptions[0], ResolutionPreset.high);` – Daibaku Aug 24 '18 at 17:38
  • Yes im doing that. But this function only responds to: `case "high": minPreviewSize = new Size(1024, 768); break; ` The actual size is then computed in: `computeBestPreviewAndRecordingSize` That is all working fine. Has something to do with the bitrate... – Markus Aug 25 '18 at 12:25
  • @Markus Hey, I'm having the same problem. The video quality is very poor. Did you found any solution for it? – divyanshu bhargava Jan 23 '19 at 14:50

1 Answers1

1

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

divyanshu bhargava
  • 1,513
  • 1
  • 13
  • 24