OpenCVFrameGrabber not working in my android project (Error: Could not read frame in start())
#893 opened on Jan 28, 2018
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
OpenCVFrameGrabber is not working in my project, and I wonder if it is caused by those three .so files shown in the first three warnings (highlighted in bold below). I have already put all the required files (javacpp.jar, javacv.jar, opencv*.jar and ffmpeg*.jar) in the /libs folder, and added those jar files under the Dependencies setting.
How can I solve this issue?
Logs:
W/linker: .../lib/arm/libjniopencv_imgproc.so: unused DT entry: type 0xf arg 0x42fe8 W/linker: .../lib/arm/libjniopencv_imgcodecs.so: unused DT entry: type 0xf arg 0x5ab7 W/linker:../lib/arm/libjniopencv_videoio.so: unused DT entry: type 0xf arg 0x3c38 W/System.err: org.bytedeco.javacv.FrameGrabber$Exception: read() Error: Could not read frame in start(). W/System.err: at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:222)
Under dependencies in app's build.gradle:
dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:design:26.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' implementation files('libs/javacpp.jar') implementation files('libs/javacv.jar') implementation files('libs/opencv.jar') implementation files('libs/opencv-android-arm.jar') implementation files('libs/opencv-android-x86.jar') implementation files('libs/ffmpeg.jar') implementation files('libs/ffmpeg-android-arm.jar') implementation files('libs/ffmpeg-android-x86.jar') }