CRASH | When trying to Save Video.
Closed this issue · 6 comments
Hello Developer!
I appreciate your all Hard Work!!
I am trying to save the video. I have written the Code from WIKI.
I am getting below errors -
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: mappractise.tv.com.demovideofilter, PID: 21407 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:324) at org.bytedeco.javacpp.Loader.load(Loader.java:413) at org.bytedeco.javacpp.Loader.load(Loader.java:381) at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2597) at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:386) at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:380) at mappractise.tv.com.demovideofilter.VideoProcessing.doInBackground(VideoProcessing.java:49) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
Are you copying my code exactly? If so then send me your gradle file.
YES, I am copying the exact code.
Below is my gradle file.
`apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "mappractise.tv.com.demovideofilter"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
pickFirst 'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.sherazkhilji.videffects:videffects:1.0.1@aar'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile group: 'org.bytedeco', name: 'javacv', version: '1.1'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'
}
`
Try changing this line:
targetSdkVersion 23
to
targetSdkVersion 22.
Hope it will resolve your issue.
I already tried that, but unable to fix the issue. Please let me know what wrong i am doing. :)
Ok try to change javacv version to 1.2.2. May be that will help. Also tell me the Android OS version you are using.
Issue resolved by changing the version of javacv
compile group: 'org.bytedeco', name: 'javacv', version: '1.3'