在卫报的项目ffmpeg的安卓文档 [英] Documentation on Guardian project ffmpeg android

查看:147
本文介绍了在卫报的项目ffmpeg的安卓文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从下面的链接

的Gaurdian项目FFMPEG的Andr​​oid的Java

<一个href="https://github.com/guardianproject/android-ffmpeg-java">https://github.com/guardianproject/android-ffmpeg-java

有没有提供给使用库code什么好的文件。它很难用无证件。 PLZ帮我。

解决方案

我设法得到它的工作。

首先,下载监护人项目的ffmpeg 库项目

然后,它在Eclipse导入。 (没必要跟着他们构建过程,与NDK只需要导入他们的项目在直接蚀)

然后右键单击您的主项目(而不是库项目) - >属性 - > Android的 - >库 - >添加

然后,使用这种方式:

  

文件fil​​eTmp = context.getActivity()getCacheDir()。                 文件fil​​eAppRoot =新的文件(context.getActivity()getApplicationInfo()DATADIR);

  FfmpegController FC =新FfmpegController(fileTmp,fileAppRoot);


          最终剪辑出=新片段(compiled.mp4);
 

  fc.concatAndTrimFilesMP4Stream(视频,出,虚,实,新ShellUtils.ShellCallback(){

        @覆盖
        公共无效shellOut(字符串shellLine){
            的System.out.println(MIX&GT;+ 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.

这篇关于在卫报的项目ffmpeg的安卓文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆