jonataslaw / VideoCompress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
MIT License
231 stars 283 forks source link

How to check the selected video is compressed or not #151

Open aravind-b-dev opened 2 years ago

aravind-b-dev commented 2 years ago

I want to upload video without compressing, if the video is alrady compressed.

I want to upload a video from local storage to server

dependancy : video_compress: ^3.1.0

I used to compress video with video_compress: ^3.1.0 package. Its working perfectly. But, when i upload a compressed video again it takes more time to compress. So i want to upload without compressing, if the video is alrady compressed.

here is my code to compress a video

  MediaInfo mediaInfo = await VideoCompress.compressVideo(
     result.files.single.path,
     quality: VideoQuality.LowQuality,
     deleteOrigin: false, // It's false by default
 );
HappySinha commented 2 years ago

It's very easy to know compressed or not you can simply .then((value) => ); Function and do whatever you want.

MediaInfo mediaInfo = await VideoCompress.compressVideo( result.files.single.path, quality: VideoQuality.LowQuality, deleteOrigin: false, // It's false by default ).then((value) => Here your upload code Exemple:-[server.putFile(value.file)], );