FFMPEG错误显示,同时符合Android [英] FFMPEG error showing while complile for android
问题描述
我正在尝试将ffmpeg添加到我的android项目中.我正在使用ubuntu 14.04操作系统.
I am trying to add ffmpeg into my android project. I am using ubuntu 14.04 OS.
我正在关注此链接. 链接
I am following this link. Link
但是执行此行时出现错误.
But I am getting error while executing this line.
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --toolchain=x86-4.8 --arch=x86 --system=linux-x86_64 --platform=android-14 --install-dir=/tmp/vplayer
我收到以下错误消息.
HOST_OS=linux
HOST_EXE=
HOST_ARCH=x86_64
HOST_TAG=linux-x86_64
HOST_NUM_CPUS=1
BUILD_NUM_CPUS=2
ERROR: Unknown option '--system'. See --help for usage.
请帮助我解决该问题并将ffmpeg添加到我的项目中.
Please help me how to solve this issue and add ffmpeg into my project.
推荐答案
您可以在项目中将FFmpeg android与工具FFmpeg Android Java
库一起使用.见下文
You can use FFmpeg android with implement FFmpeg Android Java
library in your project. see below
使用gradle
compile 'com.writingminds:FFmpegAndroid:0.3.2'
并在下面的项目中实现代码.
and implement code in your project that are below.
加载二进制文件
您必须加载二进制代码.
You must load binary code.
FFmpeg ffmpeg = FFmpeg.getInstance(context);
try {
ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onFailure() {}
@Override
public void onSuccess() {}
@Override
public void onFinish() {}
});
} catch (FFmpegNotSupportedException e) {
// Handle if FFmpeg is not supported by device
}
执行二进制文件
在这里,您已为任务传递ffmpeg命令.
Here you have pass ffmpeg command for your task.
FFmpeg ffmpeg = FFmpeg.getInstance(context);
try {
// to execute "ffmpeg -version" command you just need to pass "-version"
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onProgress(String message) {}
@Override
public void onFailure(String message) {}
@Override
public void onSuccess(String message) {}
@Override
public void onFinish() {}
});
} catch (FFmpegCommandAlreadyRunningException e) {
// Handle if FFmpeg is already running
}
更多信息参考此链接.
这篇关于FFMPEG错误显示,同时符合Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!