AbedElazizShe / light_compressor

A powerful and easy-to-use video compression plugin for Flutter.
MIT License
59 stars 34 forks source link

Compression never finishes on iOS #13

Closed Wapazz closed 3 years ago

Wapazz commented 3 years ago

Hello, I have implemented light compressor following the example. It works fine for 328 videos files out of 330. All of them come from the same device, have the same format and video quality. The issue also appear in the exemple application (latest version lightcompressor 1.1.1).

For the error itself, the issue is that there are none. No exception, no crash. It is just stuck at 100% and the response object is never filled, and no callback are called. If reading the swift code, it seem that it never opt out of: videoReader.status == .completed

I attached the video as example.

Do you need additionnal information ?

video.MOV.zip

Wapazz commented 3 years ago

Any idea where that could be coming from, or just a pointer to help me identify the issue ? Thanks a lot

AbedElazizShe commented 3 years ago

@Wapazz thank you for opening this issue. This means onSuccess was never reached most probably. Can you try version 1.2.0 and post any errors you see in the logs if the issue persists?

Thank you.

Wapazz commented 3 years ago

Hello Abed, thanks for your reply. Tried with the 1.2.0, same issue, there is 0 output in debug mode, 0 exceptions thrown, and it never gets out of the compressVideo method.

Btw, frameRate: 24 /* or ignore it */ is required not optional. Otherwise it doesn't start the compression and is stuck aswell in compressVideo.

AbedElazizShe commented 3 years ago

@Wapazz thank you for your reply, it is my bad, forgot to handle the framerate in the native code. Already fixed it.

Please test version 1.2.1, the problem should be fixed too, you should be able to compress the attached video. The thing is I don't have a Mac with me at the moment, so fixing and testing on ios haven't been great. You would do me a favor if you let me know if your issue is resolved now.

Thank you.

Wapazz commented 3 years ago

Thanks so much its resolved !

Just a little typo line 205 of LightCompressor.swift it says ompletion instead of completion I think, or was it myself that deleted the letter by accident. Anyway thanks a lot :) you can close this issue as far as I'm concerned.

Wapazz commented 3 years ago

Issue fixed, tested with all 3 files that did not work on iOS. Might be necessary to correct the typo if not fixed yet in LightCompressor.swift line 205 completion(.onSuccess(destination))