siteway.blogg.se

Flutter video compress
Flutter video compress







flutter video compress
  1. #Flutter video compress how to
  2. #Flutter video compress mp4
  3. #Flutter video compress install
  4. #Flutter video compress update
  5. #Flutter video compress pro

Get media information # final info = await VideoCompress.getMediaInfo(videopath) Get File thumbnail from VideoPath # final thumbnailFile = await VideoCompress.getFileThumbnail( Get memory thumbnail from VideoPath # final uint8list = await VideoCompress.getByteThumbnail( Video compression # MediaInfo mediaInfo = await pressVideo(ĭeleteOrigin: false, // It's false by defaultĬheck compress state # VideoQuality.isCompressing

#Flutter video compress how to

How to use # Imports # import 'package:video_compress/video_compress.dart' Now in your Dart code, you can use: import 'package:video_compress/video_compress.dart'

#Flutter video compress install

You can install packages from the command line: Table of Contents #Īdd this to your package's pubspec.yaml file: dependencies: Works on ANDROID, IOS and desktop (just MacOS for now).

#Flutter video compress mp4

In addition, google chrome uses VP8/VP9, safari uses h264, and most of the time, it is necessary to encode the video in two formats, but not with this library.Īll video files are encoded in an MP4 container with AAC audio that allows 100% compatibility with safari, mozila, chrome, android and iOS. Many thanks to seel-channel who is the original creator of this library.Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.ġ00% native code was used, we do not use FFMPEG as it is very slow, bloated and the GNU license is an obstacle for commercial applications. It is important when the trim can be dragged ( controller.maxDuration The horizontalMargin param specifies the horizontal space to set around the slider. The quality param specifies the quality of the generated thumbnails, from 0 to 100 ( more info) The height param specifies the height of the generated thumbnails The controller param is mandatory so every change in the controller settings will propagate in the trim slider view To preserve preferredCropAspectRatio when crop view is rotatedĭisplay the trimmer containing video thumbnails with rotation and crop parameters. The amount of space by which to inset the crop view, not used in preview mode The controller param is mandatory so every change in the controller settings will propagate in the crop view Required VideoEditorController controller This widget is used to enable the crop actions on top of the video (CropGridViewer.edit), or only to preview the cropped result (CropGridViewer.preview). Widgets # Click to expand widgets documentation Crop 1. The selected cover thumbnail that will be used to export the final cover The sum of all the rotation applied in the editor The rotation angle set 0, 90, 180 and 270 Set to true when the rotation is different to 0 The bottom right position of the crop area (between 0.0 and 1.0)

flutter video compress

The top left position of the crop area (between 0.0 and 1.0) The minDuration possible for the trimmed area The maxDuration possible for the trimmed area Set to true when startTrim or endTrim is changing Set to true when the trimmed values are not the default video duration The duration of the selected trimmed area Return the selected cover with the controller parameters in onCompleted function Description I need to take a video from camera/gallery, compress it (lower resolution or quality or width/height) and upload to firebase storage so I can download it later and show it on a VideoPlayer on a ListView. Return the generated video with the controller parameters in onCompleted function Return the metadata of the video file in onCompleted function

#Flutter video compress update

Update the controller trim min and max values Update the controller crop min and max values Update the aspect ratio + update the crop area to the center of the video size Update the aspect ratio to the current crop area ratio Rotate the video by 90 degrees in the direction provided Init the controller parameters, the video, the trim and the cover, call cropAspectRatio MaxDuration: const Duration(seconds: initState(), // show the exported GIFįor more details check out the example. 👀 Usage # final VideoEditorController _controller = VideoEditorController.file(

#Flutter video compress pro

📸 Screenshots # Example app running on an Iphone 11 pro If you're planing to target older devices, check about the LTS release. Those Android API level and iOS deployment target are required to uses this package. Since v1.3.0, video_editor uses ffmpeg_kit_flutter main release which supports the latest features. Import 'package:video_editor/video_editor.dart'

  • Run flutter pub add video_editor, or add video_editor to pubspec.yaml file manually.
  • 📖 Installation #įollowing steps will help you add this library as a dependency in your flutter project. This library is written in Dart only but uses external packages such as ffmpeg_kit_flutter and video_thumbnail, which makes it available only on iOS and Android plaforms for now.

    flutter video compress

    The exportation is made using ffmpeg_kit_flutter library. A video editor that allows to edit (trim, crop, rotate and scale) and choose a cover with a very flexible UI design.









    Flutter video compress