How can I reduce the video recording size in flutter?
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
Comments
-
divyanshu bhargava over 1 year
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 thismediaRecorder.setVideoEncodingBitRate(3000000);
.