Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider switching from ffmpeg4android library as it costs $400 #20

Closed
kmturley opened this issue Jul 10, 2015 · 5 comments
Closed

Consider switching from ffmpeg4android library as it costs $400 #20

kmturley opened this issue Jul 10, 2015 · 5 comments

Comments

@kmturley
Copy link

Great plugin, working really well :)

Just a question, if you can switch the dependancy on the ffmpeg4android library. When running it states it's only a trial. After investigation I've found the license costs $400!!

I/Videokit﹕ licenseCheck in path: /data/data/com.example.hello/files
I/Videokit﹕ isLicExistsComplex...
I/Videokit﹕ trying to open /data/data/com.example.hello/files/ffmpeglicense.lic
I/Videokit﹕ license file found...
I/Videokit﹕ You used 1 of your 15 trial days.

I believe this is the license information here:
http://www.appfree.org/item.php?item_id=com.netcompss.ffmpeg4android
http://ffmpeg4android.netcompss.com/home/purchase

Consider switching to another library such as:
https://github.com/roman10/android-ffmpeg-tutorial
https://github.com/appunite/AndroidFFmpeg
https://github.com/guardianproject/android-ffmpeg
https://github.com/yixia/FFmpeg-Android
https://github.com/hiteshsondhi88/ffmpeg-android
https://github.com/hiteshsondhi88/ffmpeg-android-java

Thanks!

@rossmartin
Copy link
Collaborator

I found this out awhile back and there is a pull request from April 2 (#13) that has not been merged yet. I refactored the android plugin to use android-ffmpeg-java (which is actually better anyways and is free) and this pull request is ready to go fixing this issue.

Thanks.

@kmturley
Copy link
Author

awesome, will take a look!

@brodycj
Copy link

brodycj commented Jul 10, 2015

Unfortunately android-ffmpeg-java from @guardianproject is under GPL which can be a major problem for many users. I noticed https://github.com/appunite/AndroidFFmpeg has Apache 2.0 license which would be much better (though it does have some dependencies with other licenses).

@kmturley
Copy link
Author

@rossmartin I tried your pull request and it worked for a single video. Also it is logging ffmepg errors into the java console which makes things much easier!!

However when I try to use the concatAndTrimFilesMP4Stream function I run into an error. Do you know why this might be?

ArrayList<Clip> listVideos = new ArrayList<Clip>();

Clip clip = new Clip();
clip.path = new File(videoSrcPath).getCanonicalPath();
ffmpegController.getInfo(clip);
clip.duration = 5;
listVideos.add(clip);

Clip clip2 = new Clip();
clip2.path = new File(videoSrcPath2).getCanonicalPath();
ffmpegController.getInfo(clip2);
clip2.duration = 5;
listVideos.add(clip2);

Clip clipOut = new Clip();
clipOut.path = new File(outputFilePath).getCanonicalPath();
ffmpegController.concatAndTrimFilesMP4Stream(listVideos, clipOut, false, false, new ShellUtils.ShellCallback() {
    @Override
    public void shellOut(String shellLine) {
        System.out.println("fc>" + shellLine);
    }
    @Override
    public void processComplete(int exitValue) {
        if (exitValue < 0)
            System.err.println("concat non-zero exit: " + exitValue);
    }
});

The error I get is:
videoSrcPath: /storage/emulated/0/Movies/-a.mp4
videoSrcPath2: /storage/emulated/0/Movies/-b.mp4
outputFilePath: /storage/emulated/0/Movies/HelloWorld/VID_1436584506888.mp4
/storage/emulated/0/Android/data/com.example.hello/cache/ffmpeg-246029513.tmp/1.ts: Not a directory

It is creating the .ts file automatically, I am only passing in mp4 files

@kmturley
Copy link
Author

There is an issue with the datetime format function of android-ffmpeg-java here:
https://github.com/guardianproject/android-ffmpeg-java/blob/master/src/org/ffmpeg/android/FfmpegController.java#L653

I've have changed to:

long datetime = (long) mediaIn.duration * 1000;
Date date = new Date(datetime);
DateFormat formatter = new SimpleDateFormat("HH:mm:ss");
String dateFormatted = formatter.format(date);
cmd.add(dateFormatted);
Log.d(TAG, "dateFormatted: " + dateFormatted);

And it's working much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants