OpenCV on Android without OpenCV Manager

asked 2014-04-24 05:40:15 -0500

itay gravatar image

updated 2014-06-26 00:19:20 -0500

I know that my question was asked before.

But no solution is working for me.

For now I tried this solutions:

  1. Solution 1

  2. Solution 2

  3. Solution 3

  4. Solution 4

But no one of them worked for me.

My application project include a JNI part so I added all the mentioned line from THIS tutorial to the Android.mk file,

I comment this line :

if(!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, mLoaderCallback));

And added:

    static {
    if (!OpenCVLoader.initDebug()) {
        // Handle initialization error
    }
}

After public void onResume()

My application gets stuck and crushed when the OpenCV started.

This is the LogCat output:

04-16 10:00:25.020: W/System.err(14797): java.io.FileNotFoundException: /storage/emulated/0/DCIM/Frames/20140416_100025.mp4: open failed: ENOENT (No such file or directory)
04-16 10:00:25.020: W/System.err(14797):    at libcore.io.IoBridge.open(IoBridge.java:409)
04-16 10:00:25.020: W/System.err(14797):    at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
04-16 10:00:25.020: W/System.err(14797):    at java.io.FileOutputStream.<init>(FileOutputStream.java:128)
04-16 10:00:25.020: W/System.err(14797):    at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
04-16 10:00:25.025: W/System.err(14797):    at android.media.MediaRecorder.prepare(MediaRecorder.java:776)
04-16 10:00:25.025: W/System.err(14797):    at com.example.homedevice.SampleTestingAct.prepareRecorder(SampleTestingAct.java:371)
04-16 10:00:25.025: W/System.err(14797):    at com.example.homedevice.SampleTestingAct.StartTest(SampleTestingAct.java:443)
04-16 10:00:25.025: W/System.err(14797):    at com.example.homedevice.SampleTestingAct.access$0(SampleTestingAct.java:420)
04-16 10:00:25.025: W/System.err(14797):    at com.example.homedevice.SampleTestingAct$2$1.run(SampleTestingAct.java:2037)
04-16 10:00:25.025: W/System.err(14797):    at java.util.Timer$TimerImpl.run(Timer.java:284)
04-16 10:00:25.025: W/System.err(14797): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
04-16 10:00:25.025: W/System.err(14797):    at libcore.io.Posix.open(Native Method)
04-16 10:00:25.030: W/System.err(14797):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
04-16 10:00:25.030: W/System.err(14797):    at libcore.io.IoBridge.open(IoBridge.java:393)
04-16 10:00:25.030: W/System.err(14797):    ... 9 more
04-16 10:00:25.260: E/MediaRecorder(14797): start called in an invalid state: 4
04-16 10:00:25.260: W/dalvikvm(14797): threadid=16: thread exiting with uncaught exception (group=0x41c44700)
04-16 10:00:25.260: E/AndroidRuntime(14797): FATAL EXCEPTION: Timer-2
04-16 10:00:25.260: E/AndroidRuntime(14797): java.lang.IllegalStateException
04-16 10:00:25.260: E/AndroidRuntime(14797):    at android.media.MediaRecorder.start(Native Method)
04-16 10:00:25.260: E/AndroidRuntime(14797):    at com.example.homedevice.SampleTestingAct.StartTest(SampleTestingAct.java:445)
04-16 10:00:25.260: E/AndroidRuntime(14797):    at com.example.homedevice.SampleTestingAct.access$0(SampleTestingAct.java:420)
04-16 10:00:25.260: E/AndroidRuntime(14797):    at com ...
(more)
edit retag flag offensive close merge delete