haider2087 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Unsatisfied link error at lorg/bytedeco/javacpp/avcodec #483

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Followed the instruction given on website. copied javacv.jar, javacpp.jar, 
ffmpeg.jar, opencv.jar to libs.
then created a new folder armeabi and constructed all .so files from 
opencv-arm, ffmpeg-arm to armeabi.
2. libavcodec is not loaded . 
3. All the project works nicely till the line of ffmpegFrameRecorder. 

What is the expected output? What do you see instead?
I want to convert iplimages to a video.

What version of the product are you using? On what operating system?
 0.9 . downloaded from github

Please provide any additional information below.
08-22 14:54:51.121: W/dalvikvm(3589): Exception 
Ljava/lang/UnsatisfiedLinkError; thrown while initializing 
Lorg/bytedeco/javacpp/avcodec;
08-22 14:54:51.121: W/dalvikvm(3589): Exception 
Ljava/lang/ExceptionInInitializerError; thrown while initializing 
Lorg/bytedeco/javacpp/avformat;
08-22 14:54:51.121: W/dalvikvm(3589): Exception 
Ljava/lang/ExceptionInInitializerError; thrown while initializing 
Lorg/bytedeco/javacv/FFmpegFrameRecorder;
08-22 14:54:51.164: E/AndroidRuntime(3589): 
java.lang.ExceptionInInitializerError
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
com.uae.panorama360.CameraClas.createVideao(CameraClas.java:207)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
com.uae.panorama360.CameraClas.onClick(CameraClas.java:154)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.view.View.performClick(View.java:2538)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.view.View$PerformClick.run(View.java:9152)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.os.Handler.handleCallback(Handler.java:587)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.os.Looper.loop(Looper.java:130)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
android.app.ActivityThread.main(ActivityThread.java:3687)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
java.lang.reflect.Method.invokeNative(Native Method)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
java.lang.reflect.Method.invoke(Method.java:507)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
dalvik.system.NativeStart.main(Native Method)
08-22 14:54:51.164: E/AndroidRuntime(3589): Caused by: 
java.lang.ExceptionInInitializerError
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
08-22 14:54:51.164: E/AndroidRuntime(3589):     ... 13 more
08-22 14:54:51.164: E/AndroidRuntime(3589): Caused by: 
java.lang.ExceptionInInitializerError
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
java.lang.Class.classForName(Native Method)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
java.lang.Class.forName(Class.java:234)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
org.bytedeco.javacpp.Loader.load(Loader.java:385)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
org.bytedeco.javacpp.Loader.load(Loader.java:353)
08-22 14:54:51.164: E/AndroidRuntime(3589):     at 
org.bytedeco.javacpp.avformat.<clinit>(avformat.java:13)
08-22 14:54:51.164: E/AndroidRuntime(3589):     ... 14 more
08-22 14:54:51.164: E/AndroidRuntime(3589): Caused by: 
java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1963]:  1581 
could not load needed library 'libavcodec.so' for 'libjniavcodec.so' 
(find_library[1220]:  1581 'libavcodec.so' failed to load previously)

Original issue reported on code.google.com by abid.eng...@gmail.com on 18 Aug 2014 at 10:00

GoogleCodeExporter commented 8 years ago
this is my code for iplimage conversion to video on android.
  FFmpegFrameRecorder recorder = new FFmpegFrameRecorder("/sdcard/folder/test.mpeg",200,150);

         try {

            recorder.setVideoCodec(13);
            recorder.setFrameRate(30);
            recorder.setPixelFormat(avutil.PIX_FMT_RGB);
            recorder.start();

            for (int i=0;i<rgbImage.length;i++)
            {
               recorder.record(rgbImage[i]);
            }
            recorder.stop();
         }
         catch (Exception e){
            e.printStackTrace();
         }

Original comment by abid.eng...@gmail.com on 18 Aug 2014 at 10:02

GoogleCodeExporter commented 8 years ago
Hi, I'm running into a similar problem, did you find a solution for this?

thank you

Original comment by dani.bol...@gmail.com on 21 Aug 2014 at 3:14

GoogleCodeExporter commented 8 years ago
yes i have redownloaded all the jar files and created a new workspace and then 
a new project. only then i was able to solve

Original comment by abid.eng...@gmail.com on 21 Aug 2014 at 3:19

GoogleCodeExporter commented 8 years ago
I cannot get it to work, it complains about " 1898 could not load needed 
library 'libswresample.so", but that library is there, all the .so libraries 
are in the right place /libs/armeabi , however it seems like it cannot find the 
libswresample.so library

Any idea? 

the complete error message is below, I have tried to redownload all libraries, 
etc but that made no difference. thanks

12-31 21:47:26.260  12373-12373/com.example.root.myapp V/Recorder﹕ 
FFmpegFrameRecorder: rtmp://live:live@128.122.151.108:1935/live/test.flv 
imageWidth: 320 imageHeight 240
12-31 21:47:26.305  12373-12375/com.example.root.myapp D/dalvikvm﹕ 
GC_CONCURRENT freed 220K, 6% free 12352K/13063K, paused 13ms+1ms, total 25ms
12-31 21:47:26.305  12373-12373/com.example.root.myapp D/dalvikvm﹕ 
WAIT_FOR_CONCURRENT_GC blocked 4ms
12-31 21:47:26.330  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /system/lib/libc.so 0x419cd358, skipping init
12-31 21:47:26.330  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /system/lib/libm.so 0x419cd358, skipping init
12-31 21:47:26.335  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /system/lib/libz.so 0x419cd358, skipping init
12-31 21:47:26.335  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /system/lib/libdl.so 0x419cd358, skipping init
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /system/lib/liblog.so 0x419cd358, skipping init
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ Trying to 
load lib /data/data/com.example.root.myapp/lib/libavutil.so 0x419cd358
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ Added 
shared lib /data/data/com.example.root.myapp/lib/libavutil.so 0x419cd358
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ No 
JNI_OnLoad found in /data/data/com.example.root.myapp/lib/libavutil.so 
0x419cd358, skipping init
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ Trying to 
load lib /data/data/com.example.root.myapp/lib/libjniavutil.so 0x419cd358
12-31 21:47:26.340  12373-12373/com.example.root.myapp D/dalvikvm﹕ Added 
shared lib /data/data/com.example.root.myapp/lib/libjniavutil.so 0x419cd358
12-31 21:47:26.350  12373-12375/com.example.root.myapp D/dalvikvm﹕ 
GC_CONCURRENT freed 469K, 8% free 12417K/13383K, paused 1ms+2ms, total 19ms
12-31 21:47:26.370  12373-12373/com.example.root.myapp D/dalvikvm﹕ Trying to 
load lib /data/data/com.example.root.myapp/lib/libavcodec.so 0x419cd358
12-31 21:47:26.370  12373-12373/com.example.root.myapp D/dalvikvm﹕ Trying to 
load lib /data/data/com.example.root.myapp/lib/libjniavcodec.so 0x419cd358
12-31 21:47:26.370  12373-12373/com.example.root.myapp W/dalvikvm﹕ Exception 
Ljava/lang/UnsatisfiedLinkError; thrown while initializing 
Lorg/bytedeco/javacpp/avcodec;
12-31 21:47:26.370  12373-12373/com.example.root.myapp W/dalvikvm﹕ Exception 
Ljava/lang/ExceptionInInitializerError; thrown while initializing 
Lorg/bytedeco/javacpp/avformat;
12-31 21:47:26.370  12373-12373/com.example.root.myapp W/dalvikvm﹕ Exception 
Ljava/lang/ExceptionInInitializerError; thrown while initializing 
Lorg/bytedeco/javacv/FFmpegFrameRecorder;
12-31 21:47:26.370  12373-12373/com.example.root.myapp D/AndroidRuntime﹕ 
Shutting down VM
12-31 21:47:26.370  12373-12373/com.example.root.myapp W/dalvikvm﹕ 
threadid=1: thread exiting with uncaught exception (group=0x40d862a0)
12-31 21:47:26.370  12373-12373/com.example.root.myapp E/AndroidRuntime﹕ 
FATAL EXCEPTION: main
    java.lang.ExceptionInInitializerError
            at com.example.root.myapp.MyActivity.onCreate(MyActivity.java:31)
            at android.app.Activity.performCreate(Activity.java:5184)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
            at android.app.ActivityThread.access$600(ActivityThread.java:140)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4898)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ExceptionInInitializerError
            at org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
            at 
com.example.root.myapp.MyActivity.onCreate(MyActivity.java:31)
            at 
android.app.Activity.performCreate(Activity.java:5184)
            at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
            at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
            at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
            at 
android.app.ActivityThread.access$600(ActivityThread.java:140)
            at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at 
android.app.ActivityThread.main(ActivityThread.java:4898)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
            at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ExceptionInInitializerError
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:217)
            at org.bytedeco.javacpp.Loader.load(Loader.java:385)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at org.bytedeco.javacpp.avformat.<clinit>(avformat.java:13)
            at 
org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
            at 
com.example.root.myapp.MyActivity.onCreate(MyActivity.java:31)
            at 
android.app.Activity.performCreate(Activity.java:5184)
            at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
            at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
            at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
            at 
android.app.ActivityThread.access$600(ActivityThread.java:140)
            at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at 
android.app.ActivityThread.main(ActivityThread.java:4898)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
            at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]:  1898 could not load needed library 'libavcodec.so' for 'libjniavcodec.so' (find_library[1202]:  1898 'libavcodec.so' failed to load previously)
            at java.lang.Runtime.loadLibrary(Runtime.java:370)
            at java.lang.System.loadLibrary(System.java:535)
            at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
            at org.bytedeco.javacpp.Loader.load(Loader.java:410)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at org.bytedeco.javacpp.avcodec.<clinit>(avcodec.java:12)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:217)
            at org.bytedeco.javacpp.Loader.load(Loader.java:385)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at 
org.bytedeco.javacpp.avformat.<clinit>(avformat.java:13)
            at 
org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
            at 
com.example.root.myapp.MyActivity.onCreate(MyActivity.java:31)
            at 
android.app.Activity.performCreate(Activity.java:5184)
            at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
            at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
            at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
            at 
android.app.ActivityThread.access$600(ActivityThread.java:140)
            at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at 
android.app.ActivityThread.main(ActivityThread.java:4898)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
            at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]:  1898 could not load needed library 'libswresample.so' for 'libavcodec.so' (load_library[1094]: Library 'libswresample.so' not found)
            at java.lang.Runtime.loadLibrary(Runtime.java:370)
            at java.lang.System.loadLibrary(System.java:535)
            at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
            at org.bytedeco.javacpp.Loader.load(Loader.java:401)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at 
org.bytedeco.javacpp.avcodec.<clinit>(avcodec.java:12)
            at java.lang.Class.classForName(Native Method)
            at java.lang.Class.forName(Class.java:217)
            at org.bytedeco.javacpp.Loader.load(Loader.java:385)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at 
org.bytedeco.javacpp.avformat.<clinit>(avformat.java:13)
            at 
org.bytedeco.javacv.FFmpegFrameRecorder.<clinit>(FFmpegFrameRecorder.java:106)
            at 
com.example.root.myapp.MyActivity.onCreate(MyActivity.java:31)
            at 
android.app.Activity.performCreate(Activity.java:5184)
            at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
            at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
            at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
            at 
android.app.ActivityThread.access$600(ActivityThread.java:140)
            at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at 
android.app.ActivityThread.main(ActivityThread.java:4898)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
            at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
            at dalvik.system.NativeStart.main(Native Method)

Original comment by dani.bol...@gmail.com on 21 Aug 2014 at 7:47

GoogleCodeExporter commented 8 years ago
https://github.com/bytedeco/javacv/issues/24

Original comment by samuel.a...@gmail.com on 22 Aug 2014 at 12:45

GoogleCodeExporter commented 8 years ago
Thanks a lot for your help Samuel :)

Do I need to rebuild javacv myself in order to apply the fix that you added?

thanks

Original comment by dani.bol...@gmail.com on 26 Aug 2014 at 3:17

GoogleCodeExporter commented 8 years ago
i dont know much however i have just redownloaded all the files and created
new project in new workspace. then copied all the jar files and extracted
.so files

Original comment by abid.eng...@gmail.com on 27 Aug 2014 at 3:50

GoogleCodeExporter commented 8 years ago
Please find corresponding binaries here:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacv/0.9.
1-SNAPSHOT/

Original comment by samuel.a...@gmail.com on 29 Aug 2014 at 12:53