关于Guardian项目ffmpeg android的文档

Azh*_*iri 6 android ffmpeg

我从以下链接获得了Gaurdian Project FFMPEG android java

https://github.com/guardianproject/android-ffmpeg-java

是否有任何好的文档可以使用该库代码.没有文档很难使用它.Plz帮助我.

Tai*_*iko 6

我设法让它工作.

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

然后在eclipse中导入它.(无需遵循他们的构建过程,NDK只是直接在eclipse中导入他们的项目)

然后右键单击您的Main项目(而不是库项目) - > Properties - > Android - > Library - > Add

然后,以这种方式使用它:

  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);
                }
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

使用ArrayList<Clip>您想要连接的视频.