Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading class in FFmpegFrameRecorder #81

Closed
bakua opened this issue Jan 9, 2015 · 10 comments
Closed

Error loading class in FFmpegFrameRecorder #81

bakua opened this issue Jan 9, 2015 · 10 comments
Labels

Comments

@bakua
Copy link

bakua commented Jan 9, 2015

Dear guys,
I have a Android Studio project with:

compile 'org.bytedeco:javacv:0.10'
compile 'org.bytedeco:javacpp:0.10'
compile 'org.bytedeco.javacpp-presets:ffmpeg:2.5.1-0.10'
compile 'org.bytedeco.javacpp-presets:opencv:2.4.10-0.10'

And I'd like to instantiate FFmpegFrameRecorder. But as soon as I call:

new FFmpegFrameRecorder(path, outputResolution.getWidth(), outputResolution.getHeight(), 1);

The app crashes. There is no exception stack trace or anything, only this error message in LogCat:
E/javacpp﹕ Error loading class com/googlecode/javacpp/Loader.

I have debugged it and it happens in tryLoad() method during the call of:

Loader.load(org.bytedeco.javacpp.avutil.class);
Loader.load(org.bytedeco.javacpp.swresample.class);
Loader.load(org.bytedeco.javacpp.avcodec.class);
Loader.load(org.bytedeco.javacpp.avformat.class);
Loader.load(org.bytedeco.javacpp.swscale.class);

Do you please have any idea what can be wrong? I was using some old version of JavaCV(with old package, same as is in error) and I need to update it.

Thank you,
bakua

@saudet
Copy link
Member

saudet commented Jan 9, 2015

Have you set the platform.dependency system property somewhere for Gradle and the Android platform? I don't know how to do it myself, and it might not work with Android anyway. So, if all else fails, please try the manual installation instructions here:
https://github.com/bytedeco/javacv#manual-installation
That works fine for me. Does any of that work for you?

@bakua
Copy link
Author

bakua commented Jan 9, 2015

Hello :) Thanks for your reply. I did some research on your answer and I didn't found any way hot to set platform.dependecy with Android Studio.

Also I've tried manual installation and downloaded all jars from maven repo. Or is it like I should download only JavaCV jars from maven repo and then download other libraries from somewhere else?

Though I think that it is not problem in opencv or ffmpeg because it says it can't find Loader class which is locaten in JavaCPP library. Interesting thing for me is why it is trying to open Loader for com/googlecode/javacpp/Loader instead for org.bytecode...

Thank you

@saudet
Copy link
Member

saudet commented Jan 10, 2015

I guess what you're doing is fetching an old version of JavaCPP for some reason.

Anyway, what happens when you put all the JAR files manually in your project?

@bakua
Copy link
Author

bakua commented Jan 10, 2015

That is the first thing I tried. Do you think it can be possible that some
of .so libraries for ffmpeg or opencv require old javacv version?

Thanks
On Jan 10, 2015 2:33 AM, "Samuel Audet" [email protected] wrote:

I guess what you're doing is fetching an old version of JavaCPP for some
reason.

Anyway, what happens when you put all the JAR files manually in your
project?


Reply to this email directly or view it on GitHub
#81 (comment).

@saudet
Copy link
Member

saudet commented Jan 10, 2015

No, they were all built together and I verified that they do actually work. Please make sure to provide any information about what happens when you try to follow the instructions. Everything works fine here, so I can't fix what isn't broken! Thank you

@bakua
Copy link
Author

bakua commented Jan 10, 2015

Sorry, that is not what I meant. I wanted to know if I have to update .so files as well when I am updating to newer .jar libraries. For exaple everytime avutil.java is updated, do I usually need to update libavutil.so as well?

@saudet
Copy link
Member

saudet commented Jan 10, 2015

Yes, of course.

@bakua
Copy link
Author

bakua commented Jan 10, 2015

And is there any place where we can download latest .so files compiled for armeabi-v7a please? Or is the only possibility to build it ourselves.

Thank you

@saudet
Copy link
Member

saudet commented Jan 10, 2015

@bakua
Copy link
Author

bakua commented Jan 10, 2015

Oh thank you very much, it is working now :) I've missed that important piece of information that .so files are in .jar files of according library. Your suggestions were very helpful :)

Also someone might find this interesting http://stackoverflow.com/questions/20890116/javacv-android-studio-gradle-possible

Have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants