如何在Android上使用Java/Kotlin减小视频大小? [英] How to reduce video size with java/kotlin on Android?

查看:81
本文介绍了如何在Android上使用Java/Kotlin减小视频大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想减小Android Studio上的视频大小,并且要上传到PlayStore必须兼容64位架构,我之前尝试使用ffmpeg并成功压缩了mp4,但耗时较长,而这种3gp的解决方案不包含音频.还有其他选项或库可以用音频和视频压缩mp4和3gp吗?

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?

推荐答案

这是的另一个库压缩视频.该库可以压缩低,中和高质量的视频.用法示例:

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.
    }
});

这篇关于如何在Android上使用Java/Kotlin减小视频大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆