How to install JavaCV on Android and use FrameGrabber

后端 未结 4 1205
感动是毒
感动是毒 2021-02-06 07:14

Could someone tell me where I\'m doing wrong? These are the steps that I have followed:

  1. Downloaded the adt-bundle-windows from android developer website

相关标签:
4条回答
  • 2021-02-06 07:52

    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

    0 讨论(0)
  • 2021-02-06 08:02

    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

    0 讨论(0)
  • 2021-02-06 08:11

    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!

    0 讨论(0)
  • 2021-02-06 08:11

    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'
    }
    
    0 讨论(0)
提交回复
热议问题