Android Studio:压缩视频和音频 [英] Android Studio : Compress Video and Audio
问题描述
正在Android Studio中压缩视频和音频文件.我需要有用的建议和链接. 我浏览了其中的一些链接,但发现并没有太大帮助. 如何在android中压缩视频`,
Working to compress Video and Audio files in Android Studio. I need Useful suggestion and links. I went through some of these links but didn't found much helpful . How to compress video in android` ,
是否可以压缩android中的音频和视频文件,以编程方式提供?,
FFmpegFrameGrabber在尝试尝试时崩溃了100%在Android上压缩视频
请帮助我.谢谢
推荐答案
您可以在Android项目中使用ffmpeg压缩视频.
You can use ffmpeg in your Android project to compress video.
有很多方法,但是一种常见的方法是在ffmpeg命令行工具周围使用包装器.这使您可以使用mpeg的常规语法,该语法已被很好地证明.
There are a number of approaches but a common approach is to use a wrapper around the ffmpeg command line tool. This allows you use the regular syntax off mpeg which is well documented.
作为示例,此代码使用ffmpeg在Android中压缩mp4文件:
As an example, this code uses ffmpeg to compress an mp4 file in Android:
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包装器.
The above, from https://github.com/mickod/ColabAndroidHelper, uses a custom ffmpeg wrapper.
我认为,现在有许多Android ffmpeg包装器库似乎都得到了很好的支持,并且最好使用,例如-
There are a number of Android ffmpeg wrapper libraries now which seem to be well supported and which would be better to use, I think - one example is:
这篇关于Android Studio:压缩视频和音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!