Closed kamami closed 5 years ago
You can call _flutterVideoCompress.isCompressing
for check. Or use the following example to confirm the compression progress.
_subscription = _flutterVideoCompress.compressProgress$.subscribe((progress) {
print('progress: $progress');
});
Currently does not support concurrency, the compression on the phone will be very slow, I think this is not difficult to understand :)
Mhh ok, but why did you not do that in your own example file? I mean, this problem occurs when I run your project. I did not change a bit of your code, just cloned it, ran and captured some videos in a row. First time everything works fine, second time:
Already have a compression process, you need to wait for the process to finish
No hate, just some feedback :) Great job with this project btw!
I checked it a bit more in detail and it seems to occure mainly when picking a video out of the gallery. First time is working fine, second time the compressing process is not starting (no progress in the console, just: Running publishing updates method) third time throwing the error I mentioned above.
Thanks for your feedback, maybe some of the places I tested are not very detailed. I want to know the code associated with gallery.
I just changed the datasource and let everything else untouched:
File file = await ImagePicker.pickVideo(source: ImageSource.gallery);
I did some research and found this:
https://stackoverflow.com/questions/40070987/android-ffmpeg-do-nothing
The second answer is really interesting!
You want to say about overwrite the existing file?
Yes exactly! In my testing, when selecting a new video from gallery to compress, it is working fine in most cases. But when testing with always the same video, the compression seems not to start. Could be just coincident, but meybe thats the reason.
This is not associated with FFmpeg, I judged in the code whether the file exists. . .
When compressing a second video after compressing the first one, I get following Error:
It seems that the compression process of the first video is still in progress. Does it not stop automatically? Do I need to stop it manually by calling
_stopCompress()
?Thanks for your help!