I tried using flutter's light_compressor package to compress a video I shot with my phone or downloaded from YouTube.
I refer to the article below. https://morioh.com/p/ac6f0d2c176b In this article, the minimum bit rate can be set and the default value is 2mbps.
However, in the sample code, only the flag isMinBitrateCheckEnabled exists, and there is no parameter to set a specific bit rate.
How do I compress the video to my desired bitrate?
Below is a part of the sample code.
import 'package:light_compressor/light_compressor.dart';
final LightCompressor _lightCompressor = LightCompressor();
final dynamic response = await _lightCompressor.compressVideo(
path: _sourcePath,
destinationPath: _destinationPath,
videoQuality: VideoQuality.medium,
isMinBitrateCheckEnabled: false,
frameRate: 24 /* or ignore it */);
The schema for the function is:
You can set the bitrate through the
videoBitrateInMbps
attribute. Hope this helps you.