Javacv: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "vp8_short_fdct4x4_sse2"

Created on 4 May 2018  路  17Comments  路  Source: bytedeco/javacv

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "vp8_short_fdct4x4_sse2" referenced by "/data/data/com.example.app/app_lib/libavcodec.so"...

I'm trying to test it on 23, 27 API in Android Emulator x86

is it problem with x86 libs or Emulator?

I just don't have a x86 Device

bug duplicate

All 17 comments

Duplicate of #945. Please use 1.4.2-SNAPSHOT: http://bytedeco.org/builds/

java presets 1.4.2 also available or only java cv?

is there link for 1.4.2 like for 1.4.1?
http://search.maven.org/remotecontent?filepath=org/bytedeco/javacv-platform/1.4.1/javacv-platform-1.4.1-bin.zip

https://github.com/bytedeco/javacv/issues/945#issuecomment-382254737 - he uses ffmpeg 1.4.1:

Please use 1.4.2-SNAPSHOT: http://bytedeco.org/builds/

You can download the JAR files manually, but no big archive, no.

@saudet yes I just forgot about bytedeco/javacpp-presets/ffmpeg/ oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/ffmpeg/

I was trying to find ffmpeg libraries at /bytedeco/javacpp-presets/1.4.2-SNAPSHOT/ (when it should be bytedeco/javacpp-presets/ffmpeg/), my fault

I'm going to try

    implementation files('libs/javacv-1.4.2-20180501.030242-10.jar')
    implementation files('libs/javacv-platform-1.4.2-20180501.030925-9.jar')
    implementation files('libs/javacpp-1.4.2-20180430.111859-15.jar')
    implementation files('libs/ffmpeg-platform-4.0-1.4.2-20180504.074213-61.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.074158-61.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.034926-56-android-arm.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.041836-57-android-arm64.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.050321-59-android-x86.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.054338-60-android-x86_64.jar')

hope it will work, there are so many files with different version/date, I was trying to download most recent ones (at page end)

new issues with those libraries when trying to start recording mFFmpegFrameRecorder.start():

05-04 11:30:59.898 15273-15273/ W/System.err: org.bytedeco.javacv.FrameRecorder$Exception: avcodec_find_encoder() error: Video codec not found.
05-04 11:30:59.898 15273-15273/ W/System.err:     at org.bytedeco.javacv.FFmpegFrameRecorder.startUnsafe(FFmpegFrameRecorder.java:447)

is it a new bug? or did I do something wrong?

You probably have old files in your project somewhere that we not recompiled...

I only compiled those files:

    implementation files('libs/javacv-1.4.2-20180501.030242-10.jar')
    implementation files('libs/javacv-platform-1.4.2-20180501.030925-9.jar')
    implementation files('libs/javacpp-1.4.2-20180430.111859-15.jar')
    implementation files('libs/ffmpeg-platform-4.0-1.4.2-20180504.074213-61.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.074158-61.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.034926-56-android-arm.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.041836-57-android-arm64.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.050321-59-android-x86.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.054338-60-android-x86_64.jar')

can you please check Recorder with exactly the same files?

Those are already compiled. What you need to recompile is the source code
of your application and of any other library that depends on JavaCV.

I meant I added them to my build gradle file (replace old java entries with those), made project in Android Studio and it how it worked
I'll try again later of course, but I think I will get the same error

mb with gradle maven repository in android project (no jars in libs) it will work better:

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
   ...

I'm trying:

ext {
    versions = [
            'ffmpeg': '4.0-1.4.2-SNAPSHOT'
    ]
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation(group: 'org.bytedeco', name: 'javacv-platform', version: '1.4.2-SNAPSHOT') {
        exclude group: 'org.bytedeco.javacpp-presets'
    }
    implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: versions.ffmpeg
    implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: versions.ffmpeg, classifier: 'android-arm'

but get error for preset:

Failed to resolve: ffmpeg-android-arm

or .so lib files I download manually and try later (mb it will work ok)

    // implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.034926-56-android-arm.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.041836-57-android-arm64.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.050321-59-android-x86.jar')
    implementation files('libs/ffmpeg-4.0-1.4.2-20180504.054338-60-android-x86_64.jar')

yes it worked :) at least on my arm64 device, I'll test on x84 emulator later

actually I found what really was the issue

in previous versions (JavaCV FFmpeg 3.*) I used: mFrameRecorder.setVideoCodec(28); // 28 == avcodec.AV_CODEC_ID_H264 and it was working ok

but from FFMpeg 4.0 (I guess) it's not 28 anymore but 27, AV_CODEC_ID_H264 = 27
so it's better to use mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);

Yes, it's never a good idea to use numbers there :)

checked again it also worked for 8.1 x86 Android Emulator using 1.4.2-SNAPSHOT :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fif10 picture fif10  路  3Comments

eldhosengeorge picture eldhosengeorge  路  3Comments

Maleandr picture Maleandr  路  3Comments

y4nnick picture y4nnick  路  3Comments

chrisliu12345 picture chrisliu12345  路  4Comments