Khalid Mohammed
Khalid Mohammed

Reputation: 463

compress videos in flutter

I face one issue in my application, I want to pick video from the gallery, then compress the video to limit size.

For Example: Size of video picked from the gallery: 20MB ----> I want to compress this video to be 2MB maximum.

I used this https://pub.dev/packages/flutter_video_compress, but still I cannot reduce the size to what I want, It means I cannot give a limit of video compression.

Upvotes: 1

Views: 2143

Answers (1)

Ravinder Kumar
Ravinder Kumar

Reputation: 8010

You should try quality: VideoQuality.LowQuality for best compression,

 final MediaInfo info = await _flutterVideoCompress.compressVideo(
          file.path,
          deleteOrigin: true,
          quality: VideoQuality.LowQuality,
        );

Upvotes: 1

Related Questions