Closed
Description
mFrameRecorder = new FFmpegFrameRecorder(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES).getAbsolutePath() + File.separator + "new.mp4", 480, 480, 1);
crash happened in this code after i update my nexus5 to Marshmallow,and it works fine before.And the error log below:
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: FATAL EXCEPTION: main
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: Process: com.beak.petsfbi, PID: 22095
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at java.lang.Class.classForName(Native Method)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at java.lang.Class.forName(Class.java:324)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at org.bytedeco.javacpp.Loader.load(Loader.java:390)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at org.bytedeco.javacpp.Loader.load(Loader.java:358)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1407)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at com.beak.petsfbi.activity.VideoRecorderActivity.startRecord(VideoRecorderActivity.java:177)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at com.beak.petsfbi.activity.VideoRecorderActivity$1.onClick(VideoRecorderActivity.java:57)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.view.View.performClick(View.java:5198)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.view.View$PerformClick.run(View.java:21147)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-06 16:15:28.015 22095-22095/com.beak.petsfbi E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Activity
phajduk commentedon Oct 6, 2015
+1 I have the same problem.
saudet commentedon Oct 7, 2015
Did they break backward compatibility? Is there any info on that from Google?
boybeak commentedon Oct 7, 2015
@saudet My android studio version is 1.4, compileSdkVersion 23, buildToolsVersion 23.0.0
boybeak commentedon Oct 7, 2015
@saudet I've been tried all the solution in #133 ,but not working
boybeak commentedon Oct 7, 2015
@saudet Similar problem find here:https://code.google.com/p/android-developer-preview/issues/detail?id=3028 , it seems no solution.
tomerhatav commentedon Oct 8, 2015
+1 I have the same problem here. :(
boybeak commentedon Oct 9, 2015
@tomerhatav @saudet @phajduk I find a official page maybe useful https://developer.android.com/intl/ko/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime
zavadpe commentedon Oct 21, 2015
As boybeak wrote, official release page explicitly refers to loading of shared libraries with text relocations:
saudet commentedon Oct 21, 2015
@zavadpe If you know what we need to do for that, please update the instructions on this wiki page: https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments
zavadpe commentedon Oct 21, 2015
I did only simple workaround for now as suggested in the text I quoted - I decreased target SDK to 22 in my project.
Long term solution requires ffmpeg libraries (I saw avutil causing an error) to be built without text relocations but I have no experience how to do that. But developer site suggests to go here where good instructions can be found how to find those textrels. However I may take look at it later.
ryango commentedon Nov 2, 2015
What version of ffmpeg is being used in the binary distro of javacv? According to
http://stackoverflow.com/questions/32346402/libavcodec-so-has-text-relocations there are 2 commits that change how android is built
FFmpeg/FFmpeg@f963f80
FFmpeg/FFmpeg@cb416a7
Looks like they have been around since 2.6?
ryango commentedon Nov 5, 2015
Actually not since 2.6. Seems like it's only in unreleased master. Pulling latest Ffmpeg master and compiling with ndk-r10e in checking avcodec.so. Looks like it'll be with 2.9 when they gm that release. Having linker issues now with the jni when I just swap out the .so files (expected). I guess I have to build javacv, javacpp and ffmpeg from scratch.
ryango commentedon Nov 5, 2015
Haha I'm just going to keep spamming here, apologies. Looks like has been in since 2.6. Verified building with r10e and 2.8 release HEAD I get no text relocations in avcodec. Same linker issue with the jni. Will try to rebuild all the deps, though you should consider pulling latest ffmpeg if you haven't and building the android libs before everyone who uses javacv in android comes calling.
49 remaining items
pedroSG94 commentedon May 13, 2016
I tried with those binaries and know crash with this error:
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 16167
Only a line no more log.
According this post:
https://hub.jmonkeyengine.org/t/adnroid-project-fails-with-a-libc-fatal-signal-11-sigsegv-code-2-fault-addr-0x40a00000-in-tid-21434-gcdaemon/34034/3
Native libc tries to access invalid address
pedroSG94 commentedon May 13, 2016
more log for my error:
saudet commentedon May 13, 2016
@pedroSG94 It looks like you're hitting bug #133. Please follow the workaround, or if you don't like it, please report the problem upstream to Google. If you don't complain, they will not listen.
pedroSG94 commentedon May 16, 2016
this link is down
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacv/1.2-SNAPSHOT/
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp/1.2-SNAPSHOT/
saudet commentedon May 16, 2016
Yes, version 1.2 has been released. Please use that version:
http://search.maven.org/#search|ga|1|bytedeco
saudet commentedon May 16, 2016
And thanks to you all for helping me debug this!!
jsichi commentedon Jun 12, 2016
@pedroSG94 : I hit the same sigsegv stack as you. To fix it, besides upgrading to 1.2, I also needed to use 1.2.1 for the version of the javacpp artifact (even though all of the other artifacts are currently at 1.2.
So in my build.sbt:
praveen-kanwar commentedon Jun 7, 2017
In gradle simply put this lines
monxarat commentedon Aug 1, 2017
@praveen-kanwar Thank you so much.