微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

关于Guardian项目ffmpeg android的文档

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

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

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

解决方法

我设法让它工作.

首先,下载监护人项目ffmpeg library project

然后在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>您想要连接的视频.

原文地址:https://www.jb51.cc/android/309615.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐