How to install JavaCV on Android and use FrameGrabber

二次信任 提交于 2019-12-03 04:06:59

So a jar file is basically a zip file, if you change the extension to ".zip" you can extract the files it contains like you did with OpenCV and FFMPEG.

So, rename "javacv-android-arm.jar" to " javacv-android-arm.zip," extract the .so files out of it and copy them to libs/armeabi.

Good luck!

Gradle:

compile 'org.bytedeco:javacv:1.0' compile 'org.bytedeco.javacpp-presets:opencv:2.4.11-0.11:android-x86' compile 'org.bytedeco.javacpp-presets:ffmpeg:2.6.1-0.11:android-x86' compile 'org.bytedeco.javacpp-presets:opencv:2.4.11-0.11:android-arm' compile 'org.bytedeco.javacpp-presets:ffmpeg:2.6.1-0.11:android-arm'

this will integrate javacv to android

Use this example:

http://javacv4android.blogspot.com.br/2014/02/how-to-import-javacv-libraries-to.html

later in OnCreate:

try {
        FrameGrabber grabber2 = new FFmpegFrameGrabber(Environment
                .getExternalStorageDirectory().getAbsolutePath()
                + "/TESTE/spell.mp3");

        String t = "!";

        grabber2 = null;

    } catch (Exception e) {
        e.printStackTrace();
    }

if don't exist error, it's ok =)

Sorry for my english

For latest version. In build.gradle:

repositories {
...
   mavenCentral()
}
dependencies {
...
   compile group: 'org.bytedeco', name: 'javacv', version: '1.2'
   compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version:   '3.1.0-1.2', classifier: 'android-arm'
   compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version:   '3.1.2-1.2', classifier: 'android-arm'
}
configurations {
   all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!