android视频压缩
效果图
选择当前视频大小为 65.57MB 压缩有三种方式
分别对应的是 High Mediunm Low 上面用的是Low 最小的
public static VideoCompressTask compressVideoHigh(String srcPath, String destPath, CompressListener listener) {
VideoCompressTask task = new VideoCompressTask(listener, VideoController.COMPRESS_QUALITY_HIGH);
task.execute(srcPath, destPath);
return task;
}
public static VideoCompressTask compressVideoMedium(String srcPath, String destPath, CompressListener listener) {
VideoCompressTask task = new VideoCompressTask(listener, VideoController.COMPRESS_QUALITY_MEDIUM);
task.execute(srcPath, destPath);
return task;
}
public static VideoCompressTask compressVideoLow(String srcPath, String destPath, CompressListener listener) {
VideoCompressTask task = new VideoCompressTask(listener, VideoController.COMPRESS_QUALITY_LOW);
task.execute(srcPath, destPath);
return task;
}
压缩成功之后效果 视频文件会在下面的输出地址中显示