Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation on Guardian project ffmpeg android

Tags:

android

ffmpeg

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.

like image 502
Azhagiri Avatar asked Oct 14 '13 07:10

Azhagiri


1 Answers

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 an ArrayList<Clip> of videos you want to concatenate.

like image 89
Taiko Avatar answered Nov 12 '22 12:11

Taiko