在Android Studio中压缩视频和音频文件。我需要有用的建议和链接。 我浏览了一些这些链接,但没有找到很多帮助。 How to compress video in android`,
Is there possibility to compress audio and video file in android programmatically?,
FFmpegFrameGrabber crashes 100% of time attempting to compress video on Android
请帮帮我。感谢
答案 0 :(得分:2)
您可以在Android项目中使用ffmpeg压缩视频。
有许多方法,但常见的方法是在ffmpeg命令行工具周围使用包装器。这允许你使用常规语法off mpeg,这是很好的文档。
例如,此代码使用ffmpeg压缩Android中的mp4文件:
String argv[] = {"ffmpeg", "-i", videoFileToCompress.getAbsolutePath(), "-strict", "experimental",
"-acodec", "aac", compressedVideoFile.getAbsolutePath()};
int ffmpegWrapperreturnCode = FfmpegJNIWrapper.call_ffmpegWrapper(this.ctx, argue);
以上,来自https://github.com/mickod/ColabAndroidHelper,使用自定义ffmpeg包装器。
现在有很多Android ffmpeg包装器库似乎得到了很好的支持,而且使用起来会更好,我想 - 一个例子是:
答案 1 :(得分:1)
这是怎么回事:
https://github.com/hoolrory/AndroidVideoSamples
这是一个用于在Android中处理视频的Java框架(我不知道这是否是您需要的......但请查看它)...
还有英特尔INDE(https://software.intel.com/en-us/intel-inde)和Android Media Pack,它是INDE的一部分
查看ComposerTranscodeCoreActivity.java