FFmpegFrameGrabber start()失败

时间:2015-05-04 09:41:51

标签: android javacv

我正在尝试构建一个可以处理磁盘视频的应用。 JavaCV库提供了抓取帧所需的工具。出于某种原因,我的程序在调用FrameGrabber.start()时崩溃。

我不确定我做错了什么,我是新的Android编程。我搜索过类似的案例。 Haven没有在网上发布一个与我相似的内容。

非常感谢任何帮助。

这是我实施的代码。



package test.trackerproto;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;

import com.googlecode.javacv.FFmpegFrameGrabber;
import com.googlecode.javacv.Frame;

public class Saved_process extends ActionBarActivity {
	
	String FilePath;
	
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_ffile);
		
//		VideoView display = (VideoView)findViewById(R.id.videoView1);
		
		Intent intent = getIntent();
		FilePath = intent.getStringExtra("path");
	    FFmpegFrameGrabber vidcap;
//	    display.setVideoPath(FilePath);
	    vidcap = new FFmpegFrameGrabber(this.FilePath);
    	Log.i(camera.TAG, "Framegrab initiated");
        
	    Frame cur_frame = null;

	    try 
	    {
	        vidcap.setFormat("mp4");
	        Log.i(camera.TAG, "Frame set");
	        vidcap.start();    
	    } catch (com.googlecode.javacv.FrameGrabber.Exception e) 
	    {           
	        Log.e(camera.TAG, "Failed to start grabber" + e);     
	    }
	 
	    do
	    {
	        try
	        {
	            cur_frame = vidcap.grabFrame();
	            if(cur_frame != null){
	            	Log.i(camera.TAG, "grab success");
	            }
	                
	        } catch (com.googlecode.javacv.FrameGrabber.Exception e) 
	        {
	            Log.e(camera.TAG, "video grabFrame failed: "+ e);
	        }
	    }while(cur_frame != null);

	    try 
	    {
	        vidcap.stop();
	    }catch (com.googlecode.javacv.FrameGrabber.Exception e) 
	    {
	        Log.e(camera.TAG, "failed to stop video grabber", e);
	        return;
	    }
	    
	}
}




我没有编译错误,当调用start()时失败,因为最后一个log.i是"框架集"



05-04 15:02:35.022: I/Tracker(20898): Frame set
05-04 15:02:35.078: D/dalvikvm(20898): Trying to load lib /data/app-lib/test.trackerproto-2/libjniavutil.so 0x42308da0
05-04 15:02:35.079: D/dalvikvm(20898): Added shared lib /data/app-lib/test.trackerproto-2/libjniavutil.so 0x42308da0
05-04 15:02:35.541: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.541: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.542: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.542: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.542: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.543: I/dalvikvm(20898): Could not find method java.awt.image.BufferedImage.getSampleModel, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.createFrom
05-04 15:02:35.543: W/dalvikvm(20898): VFY: unable to resolve virtual method 28530: Ljava/awt/image/BufferedImage;.getSampleModel ()Ljava/awt/image/SampleModel;
05-04 15:02:35.543: D/dalvikvm(20898): VFY: replacing opcode 0x6e at 0x0004
05-04 15:02:35.544: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.554: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.566: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.569: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.cloneBufferedImage
05-04 15:02:35.569: W/dalvikvm(20898): VFY: unable to resolve check-cast 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.569: D/dalvikvm(20898): VFY: replacing opcode 0x1f at 0x0008
05-04 15:02:35.570: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.570: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.571: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.571: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.571: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.572: E/dalvikvm(20898): Could not find class 'java.awt.Rectangle', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.copyFrom
05-04 15:02:35.572: W/dalvikvm(20898): VFY: unable to resolve new-instance 2546 (Ljava/awt/Rectangle;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.572: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0007
05-04 15:02:35.573: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.573: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/Rectangle;)
05-04 15:02:35.574: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.574: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/Rectangle;)
05-04 15:02:35.576: I/dalvikvm(20898): Could not find method java.awt.image.BufferedImage.getSampleModel, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.copyFrom
05-04 15:02:35.578: W/dalvikvm(20898): VFY: unable to resolve virtual method 28530: Ljava/awt/image/BufferedImage;.getSampleModel ()Ljava/awt/image/SampleModel;
05-04 15:02:35.578: D/dalvikvm(20898): VFY: replacing opcode 0x74 at 0x000f
05-04 15:02:35.579: W/dalvikvm(20898): VFY: unable to resolve instance field 9196
05-04 15:02:35.579: D/dalvikvm(20898): VFY: replacing opcode 0x52 at 0x009a
05-04 15:02:35.580: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.581: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.583: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.583: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.584: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.588: E/dalvikvm(20898): Could not find class 'java.awt.Rectangle', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.copyTo
05-04 15:02:35.588: W/dalvikvm(20898): VFY: unable to resolve new-instance 2546 (Ljava/awt/Rectangle;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.588: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0007
05-04 15:02:35.588: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.589: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/Rectangle;)
05-04 15:02:35.591: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.592: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/Rectangle;)
05-04 15:02:35.592: I/dalvikvm(20898): Could not find method java.awt.image.BufferedImage.getSampleModel, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.copyTo
05-04 15:02:35.593: W/dalvikvm(20898): VFY: unable to resolve virtual method 28530: Ljava/awt/image/BufferedImage;.getSampleModel ()Ljava/awt/image/SampleModel;
05-04 15:02:35.593: D/dalvikvm(20898): VFY: replacing opcode 0x74 at 0x0011
05-04 15:02:35.598: W/dalvikvm(20898): VFY: unable to resolve instance field 9196
05-04 15:02:35.598: D/dalvikvm(20898): VFY: replacing opcode 0x52 at 0x007b
05-04 15:02:35.599: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.600: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.602: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.606: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.606: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/color/ColorSpace;)
05-04 15:02:35.616: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.618: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/image/BufferedImage;)
05-04 15:02:35.619: W/dalvikvm(20898): VFY: unable to find class referenced in signature (Ljava/awt/color/ColorSpace;)
05-04 15:02:35.621: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.621: W/dalvikvm(20898): VFY: unable to resolve new-instance 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.621: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x000e
05-04 15:02:35.622: I/dalvikvm(20898): Could not find method java.awt.color.ColorSpace.getInstance, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.622: W/dalvikvm(20898): VFY: unable to resolve static method 28511: Ljava/awt/color/ColorSpace;.getInstance (I)Ljava/awt/color/ColorSpace;
05-04 15:02:35.622: D/dalvikvm(20898): VFY: replacing opcode 0x71 at 0x0033
05-04 15:02:35.627: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.627: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.627: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0052
05-04 15:02:35.629: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.629: W/dalvikvm(20898): VFY: unable to resolve check-cast 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.629: D/dalvikvm(20898): VFY: replacing opcode 0x1f at 0x0094
05-04 15:02:35.632: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.632: W/dalvikvm(20898): VFY: unable to resolve check-cast 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.632: D/dalvikvm(20898): VFY: replacing opcode 0x1f at 0x00b7
05-04 15:02:35.635: I/dalvikvm(20898): Could not find method java.awt.color.ColorSpace.getInstance, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.635: W/dalvikvm(20898): VFY: unable to resolve static method 28511: Ljava/awt/color/ColorSpace;.getInstance (I)Ljava/awt/color/ColorSpace;
05-04 15:02:35.635: D/dalvikvm(20898): VFY: replacing opcode 0x71 at 0x00c6
05-04 15:02:35.637: I/dalvikvm(20898): Could not find method java.awt.color.ColorSpace.getInstance, referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.637: W/dalvikvm(20898): VFY: unable to resolve static method 28511: Ljava/awt/color/ColorSpace;.getInstance (I)Ljava/awt/color/ColorSpace;
05-04 15:02:35.637: D/dalvikvm(20898): VFY: replacing opcode 0x71 at 0x00de
05-04 15:02:35.638: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.638: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.638: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x00fc
05-04 15:02:35.639: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.639: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.639: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x012e
05-04 15:02:35.640: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.640: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.640: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0160
05-04 15:02:35.641: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.641: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.641: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0191
05-04 15:02:35.644: E/dalvikvm(20898): Could not find class 'java.awt.image.ComponentColorModel', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.644: W/dalvikvm(20898): VFY: unable to resolve new-instance 2559 (Ljava/awt/image/ComponentColorModel;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.644: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x01c2
05-04 15:02:35.645: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.645: W/dalvikvm(20898): VFY: unable to resolve check-cast 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.645: D/dalvikvm(20898): VFY: replacing opcode 0x1f at 0x01f9
05-04 15:02:35.646: E/dalvikvm(20898): Could not find class 'java.awt.image.BufferedImage', referenced from method com.googlecode.javacv.cpp.opencv_core$IplImage.getBufferedImage
05-04 15:02:35.646: W/dalvikvm(20898): VFY: unable to resolve new-instance 2557 (Ljava/awt/image/BufferedImage;) in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;
05-04 15:02:35.646: D/dalvikvm(20898): VFY: replacing opcode 0x22 at 0x0077
05-04 15:02:35.649: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f6b at 0x1e in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.cloneBufferedImage
05-04 15:02:35.651: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f6a at 0x2d in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.cloneBufferedImage
05-04 15:02:35.658: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f5e at 0x19 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.copyFrom
05-04 15:02:35.659: I/dalvikvm(20898): DexOpt: unable to optimize instance field ref 0x23eb at 0xa3 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.copyFrom
05-04 15:02:35.661: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f5e at 0x19 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.copyTo
05-04 15:02:35.661: I/dalvikvm(20898): DexOpt: unable to optimize instance field ref 0x23eb at 0x84 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.copyTo
05-04 15:02:35.662: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f6a at 0x18 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.662: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x59 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.662: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x6f in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.663: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f6b at 0x7d in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.663: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x103 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.664: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x11b in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.666: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x135 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.667: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x14d in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.668: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x167 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.672: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x17f in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.675: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x198 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.677: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x1b0 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.678: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f78 at 0x1c9 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.678: D/dalvikvm(20898): DexOpt: unable to opt direct call 0x6f79 at 0x1e1 in Lcom/googlecode/javacv/cpp/opencv_core$IplImage;.getBufferedImage
05-04 15:02:35.707: D/dalvikvm(20898): Trying to load lib /data/app-lib/test.trackerproto-2/libtbb.so 0x42308da0
05-04 15:02:35.731: D/dalvikvm(20898): Added shared lib /data/app-lib/test.trackerproto-2/libtbb.so 0x42308da0
05-04 15:02:35.731: D/dalvikvm(20898): No JNI_OnLoad found in /data/app-lib/test.trackerproto-2/libtbb.so 0x42308da0, skipping init
05-04 15:02:35.753: D/dalvikvm(20898): Trying to load lib /data/app-lib/test.trackerproto-2/libjniopencv_core.so 0x42308da0
05-04 15:02:35.762: E/dalvikvm(20898): dlopen("/data/app-lib/test.trackerproto-2/libjniopencv_core.so") failed: dlopen failed: could not load library "libopencv_core.so" needed by "libjniopencv_core.so"; caused by library "libopencv_core.so" not found
05-04 15:02:35.763: W/dalvikvm(20898): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/javacv/cpp/opencv_core;
05-04 15:02:35.764: W/dalvikvm(20898): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/googlecode/javacv/cpp/opencv_core$CvArr;
05-04 15:02:35.768: D/AndroidRuntime(20898): Shutting down VM
05-04 15:02:35.770: W/dalvikvm(20898): threadid=1: thread exiting with uncaught exception (group=0x41a38d40)
05-04 15:02:35.793: E/AndroidRuntime(20898): FATAL EXCEPTION: main
05-04 15:02:35.793: E/AndroidRuntime(20898): Process: test.trackerproto, PID: 20898
05-04 15:02:35.793: E/AndroidRuntime(20898): java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:563)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:540)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:156)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:426)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:308)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at test.trackerproto.Saved_process.onCreate(Saved_process.java:39)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.Activity.performCreate(Activity.java:5248)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.ActivityThread.access$800(ActivityThread.java:139)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.os.Handler.dispatchMessage(Handler.java:102)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.os.Looper.loop(Looper.java:136)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at android.app.ActivityThread.main(ActivityThread.java:5086)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.reflect.Method.invokeNative(Native Method)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.reflect.Method.invoke(Method.java:515)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at dalvik.system.NativeStart.main(Native Method)
05-04 15:02:35.793: E/AndroidRuntime(20898): Caused by: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.opencv_core
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.Class.classForName(Native Method)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.Class.forName(Class.java:251)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:561)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	... 19 more
05-04 15:02:35.793: E/AndroidRuntime(20898): Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libopencv_core.so" needed by "libjniopencv_core.so"; caused by library "libopencv_core.so" not found
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.Runtime.loadLibrary(Runtime.java:364)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.System.loadLibrary(System.java:526)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:586)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:540)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:134)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	... 22 more
05-04 15:02:35.793: E/AndroidRuntime(20898): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/test.trackerproto-2.apk"],nativeLibraryDirectories=[/data/app-lib/test.trackerproto-2, /vendor/lib, /system/lib]]]: findLibrary returned null
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.Runtime.loadLibrary(Runtime.java:358)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at java.lang.System.loadLibrary(System.java:526)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:711)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	at com.googlecode.javacpp.Loader.load(Loader.java:577)
05-04 15:02:35.793: E/AndroidRuntime(20898): 	... 24 more
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。使用的javacv版本是0.7,这个版本有类似的问题(根据我的理解,大多数版本低于0.10都有类似的问题)。截至发布日期的最新版本为0.11,使用它解决了我的问题。我把它留在这里,以防它有助于某人!