AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
518 stars 117 forks source link

Compression time is too high for the larger size video #72

Closed arindamhit closed 3 years ago

arindamhit commented 3 years ago

Hi,

I am trying to compress a video which is around 900 MB size. It is getting compressed and size is coming around 200 MB. But compression time is taking around 5 mins which is too high.

My code is this:

`runOnUiThread(new Runnable() { @Override public void run() {

                        VideoCompressor.start(currentVideoPath, destVideoPath, new CompressionListener() {
                            @Override
                            public void onStart() {
                                // Compression start,
                                Log.d("Testing", "compressed onStart  ");
                            }

                            @Override
                            public void onSuccess() {
                                // On Compression success
                                Log.d("Testing", "compressed file size ");

                            }

                            @Override
                            public void onFailure(String failureMessage) {
                                // On Failure
                                Log.d("Testing", "compressed onFailure  ");
                            }

                            @Override
                            public void onProgress(float v) {
                                Log.d("Testing", "Progress::  ");
                                // Update UI with progress value
                            }

                            @Override
                            public void onCancelled() {
                                // On Cancelled
                                Log.d("Testing", "compressed onCancelled  ");
                            }
                        }, VideoQuality.MEDIUM, true, true);
                    }
                });`

I am using 0.8.1 library. Please help on this.

AbedElazizShe commented 3 years ago

@arindamhit thank you for opening this issue. Could you please try the latest version of the library and see if it takes less than that. I built this library to support medium size videos and never exexted videos that big. I will try to improve the speed in the coming weeks.

Thank you.

arindamhit commented 3 years ago

Are you talking about 0.9 version? I am not able to integrate it. It gives the error. Some one already raised the issue.

arindamhit commented 3 years ago

Hi, I upgraded to 0.9 version. But not much change. Still it takes a lot time for compressing.

Is there any further update?

arindamhit commented 3 years ago

Any update on this?

AbedElazizShe commented 3 years ago

@arindamhit sorry for the late reply. Please share the video you try to compress so i can test and optimise the performance.

arindamhit commented 3 years ago

@AbedElazizShe Sure.. I will share with you over email. Is that fine?

AbedElazizShe commented 3 years ago

@arindamhit please share a link here and give me access to it. Emails can easily be missed. Thanks

AbedElazizShe commented 3 years ago

@arindamhit please try version 0.9.8 and let me know if it's working as expected. Thank you.