我尝试使用库压缩视频,并在我用java编写的Android应用程序中运行FFmpeg命令(尽管库是在Kotlin中)我设法进行基本操作,但我将向您展示的当前操作总是失败,并出现以下错误代码:未知编码器'libx265'
库期望输入是String[],我假设有什么地方出错了,但我找不到确切的原因。
命令行
val query:Array<String> = arrayOf("-i", videoPath , "-c:v" , "libx265" ,"preset", "fast", "-crf", "30", "-tag:v", "hvc1", "-c:a", "eac3", "-b:a", "224k" , "$videoPath.mp4");
整个代码
fun videoCompress(videoPath: String) {
val query:Array<String> = arrayOf("-i", videoPath , "-c:v" , "libx265" ,"-preset", "fast", "-crf", "30", "-tag:v", "hvc1", "-c:a", "eac3", "-b:a", "224k" , "$videoPath.mp4");
CallBackOfQuery().callQuery(query, object : FFmpegCallBack {
override fun statisticsProcess(statistics: Statistics) {
Log.i("FFMPEG LOG : ", statistics.videoFrameNumber.toString())
}
override fun process(logMessage: LogMessage) {
Log.i("FFMPEG LOG : ", logMessage.text)
}
override fun success() {
Log.d("yyyy", "success: ")
}
override fun cancel() {
}
override fun failed() {
}
})
}
The Log from the code
我在build.gradle文件中添加的内容
implementation 'com.github.SimformSolutionsPvtLtd:SSffmpegVideoOperation:1.0.8'
结果(精确)
未知编码器'libx265'
1条答案
按热度按时间t98cgbkg1#
使用此库
这个命令