3

I'm using flutter camera plugin to record the video. But the recorded video size is too big. Something around 20mb for 1 min. How can I reduce the size (one of which is how to reduce resolution)? Also I have changed my VideoEncodingBitRate to 3000000. Like this mediaRecorder.setVideoEncodingBitRate(3000000);.

TruongSinh
  • 4,662
  • 32
  • 52
divyanshu bhargava
  • 1,513
  • 1
  • 13
  • 24

1 Answers1

1

To reduce the size, you can employ any or both of these 2 methods:

Resolution

You can see them in the example controller = CameraController(cameras[0], ResolutionPreset.medium);, change this to ResolutionPreset.low or some other customer value (does not have to be preset)

Encoding

You can use different encoding algorithms, such as FFmpeg using this plugin https://pub.dartlang.org/packages/flutter_ffmpeg. See also this question and its answers how to reduce size of video before upload to server programmatically in android

divyanshu bhargava
  • 1,513
  • 1
  • 13
  • 24
TruongSinh
  • 4,662
  • 32
  • 52
  • 2
    ResolutionPreset.high, ResolutionPreset.medium and ResolutionPreset.low is giving me the video of the same size. In all the 3 option I'm getting video size around 21 MB. – divyanshu bhargava Mar 04 '19 at 17:18