rurico / flutter_video_compress

Generate a new file by compressed video, and provide metadata. Get video thumbnail from a video path, supports JPEG/GIF. To reduce app size not using FFmpeg in IOS.
MIT License
188 stars 73 forks source link

[Bug] this happens when I subscribe to compressor #78

Closed sepehr13494 closed 4 years ago

sepehr13494 commented 4 years ago

Code Example (if has)

void main() {
final _flutterVideoCompress = FlutterVideoCompress();
            _conpressSubscription = _flutterVideoCompress.compressProgress$.subscribe((progress) {
                  debugPrint('progress: $progress');
                });
            File myFile = _file;
            debugPrint(_file.lengthSync().toString());
            final info = await _flutterVideoCompress.getMediaInfo(_file.path);
            print(info.toJson());
            if (info.duration > 120 || _file.lengthSync() > 5000000) {
              Fluttertoast.showToast(msg: 'در حال کم کردن حجم....');
              VideoQuality quality = VideoQuality.HighestQuality;
              if (_file.lengthSync() > 5000000) {
                quality = VideoQuality.MediumQuality;
              }
              final info2 = await _flutterVideoCompress.compressVideo(
                _file.path,
                startTime: 0,
                duration: 120,
                quality: quality, // default(VideoQuality.DefaultQuality)
                deleteOrigin: false, // default(false)
              );
              debugPrint(info2.toJson().toString());
              myFile = info2.file;
            }
}

this is the log : I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): progress: 0.0 I/flutter ( 6520): {path: /storage/emulated/0/Android/data/netonote.ir.netonote/files/flutter_video_compress/VID_20191221_010843_056.mp4, title: , author: , width: 2700, ......

aarajput commented 4 years ago

I am facing same issue.

febg11 commented 4 years ago

I have this as well but it prints 100

vahid75hj commented 4 years ago

i have same issue i

hungtran2492 commented 4 years ago

I have same issue. How to fix it?

Bidhanrai commented 4 years ago

anyone got any fixes for this?

ccamba commented 4 years ago

I have same issue.

kleytonstn commented 4 years ago

I just opened the pull request #93 that solves that issue

roberthook823 commented 3 years ago

I have same issue.