我从下面的链接
的Gaurdian项目FFMPEG的Android的Javahttps://github.com/guardianproject/android-ffmpeg-java
有没有提供给使用库code什么好的文件。它很难用无证件。 PLZ帮我。
解决方案我设法得到它的工作。
首先,下载监护人项目的ffmpeg 库项目:
然后,它在Eclipse导入。 (没必要跟着他们构建过程,与NDK只需要导入他们的项目在直接蚀)
然后右键单击您的主项目(而不是库项目) - >属性 - > Android的 - >库 - >添加
然后,使用这种方式:
文件fileTmp = context.getActivity()getCacheDir()。 文件fileAppRoot =新的文件(context.getActivity()getApplicationInfo()DATADIR);
FfmpegController FC =新FfmpegController(fileTmp,fileAppRoot);
最终剪辑出=新片段(compiled.mp4);
fc.concatAndTrimFilesMP4Stream(视频,出,虚,实,新ShellUtils.ShellCallback(){
@覆盖
公共无效shellOut(字符串shellLine){
的System.out.println(MIX>+ shellLine);
}
@覆盖
公共无效processComplete(INT exitValue){
如果(exitValue!= 0){
通信System.err.println(CONCAT非零:+ exitValue);
Log.d(FFMPEG,编译错误FFmpeg的失败);
} 其他 {
如果(新文件(out.path).exists()){
Log.d(FFMPEG,成功的文件:+ out.path);
}
}
}
});
随着视频的视频要连接一个ArrayList
I got the Gaurdian Project FFMPEG android java from the following link
https://github.com/guardianproject/android-ffmpeg-java
Is there any good documents available to use the library for code. Its difficult to use without documentation. Plz help me.
解决方案I managed to get it work.
First, download the guardian project ffmpeg library project:
Then import it in eclipse. (no need to follow their Build Procedure, with the NDK just import their project in eclipse directly)
Then right click on your Main project (not the library project) -> Properties -> Android -> Library -> Add
Then, use it this way :
File fileTmp = context.getActivity().getCacheDir(); File fileAppRoot = new File(context.getActivity().getApplicationInfo().dataDir);
FfmpegController fc = new FfmpegController(fileTmp, fileAppRoot);
final Clip out = new Clip("compiled.mp4");
fc.concatAndTrimFilesMP4Stream(videos, out, true, false, new ShellUtils.ShellCallback() {
@Override
public void shellOut(String shellLine) {
System.out.println("MIX> " + shellLine);
}
@Override
public void processComplete(int exitValue) {
if (exitValue != 0) {
System.err.println("concat non-zero exit: " + exitValue);
Log.d("ffmpeg","Compilation error. FFmpeg failed");
} else {
if(new File(out.path).exists()) {
Log.d("ffmpeg","Success file:"+out.path);
}
}
}
});
With videos an ArrayList of videos you want to concatenate.