Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce video size with java/kotlin on Android?

I want reduce the video size at Android Studio and for upload to PlayStore needs to be compatible for 64 bits arquitecture, I tried before with ffmpeg and it compress mp4 succefully but take longer time and this solution with 3gp not include the audio. Theres another option or library to compress mp4 and 3gp with audio and video?

like image 800
Pablo DbSys Avatar asked Oct 16 '22 11:10

Pablo DbSys


1 Answers

Here is another library to compress videos. This library can compress videos in low, medium and high quality. Usage example:

VideoCompress.compressVideoMedium("/storage/emulated/0/Movies/source.mp4",
        "/storage/emulated/0/Movies/Compressed/compressed.mp4",
        new VideoCompress.CompressListener() {

    @Override
    public void onStart() {
        // Compression is started.
    }

    @Override
    public void onSuccess() {
        // Compression is successfully finished.
    }

    @Override
    public void onFail() {
        // Compression is failed.
    }

    @Override
    public void onProgress(float percent) {
        // Compression is in progress.
    }
});
like image 131
Yamashiro Rion Avatar answered Oct 18 '22 09:10

Yamashiro Rion