6

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.

4

1 回答 1

6

我设法让它工作。

首先,下载守护者项目ffmpeg库项目

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

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

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

  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);
                }
            }
        }
    });

使用ArrayList<Clip>要连接的视频。

于 2014-02-04T13:03:37.443 回答