libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 48 forks source link

Errors such as java.lang.UnsatisfiedLinkError #16

Closed iMackshun closed 8 years ago

iMackshun commented 8 years ago

I apologize for my lack of experience, but can you create a video or a written tutorial about how to get this working? I tried to get this working, but I was just taking shots in the dark and ended up asking others in #libgdx on freenode and, after a few pointers, I was able to get rid of the "NoClassDefFoundError", but now i get this error. I don't know if the error is in the code that I am using(I am using your sample code) or in the .jar files that I added to the build path. It doesn't help that no one has ever tried using this.

The error: http://pastebin.com/T9RnjV5r The code that I'm using: http://pastebin.com/MjxttDTN

RBogie commented 8 years ago

Sounds like you did not include the natives jar on the classpath correctly. How are you including them?

iMackshun commented 8 years ago

For my core project I add gdx-jnigen.jar, gdx-video-desktop-natives, gdx-video-desktop, and gdx-video to the buildpath, the last two being compiled from the project you provided.(In eclipse, I exported as a .jar file) For the android project, I only add gdx-video-android to the build path. I usually keep all of the libraries I use in a folder on my hard drive and add them in eclipse using the "Add External JARs..." option. For Android, I place the JARs in the libs folder and use the "Add JARs..." option.

RBogie commented 8 years ago

That sounds like the correct way of including libraries. Can I ask on what OS you're getting this error? It might be that some dynamic library needed by ffmpeg is causing problems...

iMackshun commented 8 years ago

I'm using Mac OS X 10.10.2

RBogie commented 8 years ago

That explains... The natives jar that you can find here is not compiled for a mac. This is because the buildserver is not functioning yet, and I myself don't have any mac to do the compile on. You can try compiling the natives yourself. (You'll have to edit the build.xml in the desktop/jni folder, and then execute the mac build with it). I wish I could do more, but I have no time to change the buildscript for you atm.

Good luck!

iMackshun commented 8 years ago

Tried running the project in Windows. Now, I get this error. (http://pastebin.com/PDF97Cz7)

RBogie commented 8 years ago

A quick google gives me this link: http://www.java-gaming.org/index.php?topic=31376.0

I can't really help with this issue, since it happens outside of my code. Something goes wrong with lwjgl opening the audio device. Maybe you're having issues with your audio driver?

iMackshun commented 8 years ago

Ah! Thanks for the quick responses. When my speaker isn't connected, my audio devices are disabled. Plugging my speaker in fixes the OpenAL problem, but the "Could not open file!" remains. I'll try a different file format.

RBogie commented 8 years ago

The could not open file happens because ffmpeg (Which is used in the desktop project) can't load the videofile. The error suggests that your videofile is not a valid videofile. However, since the ffmpeg build in the project only supports ogg/theora and webm's, it could simply be that it gives this error because it cannot read the mp4 file format. The project is limited to these codecs because of licensing.

You can try a webm, or you can try compiling the native library + ffmpeg yourself with different codecs for ffmpeg included. The second option does require you to check whether you fullfill all license agreements for the specific codecs.

iMackshun commented 8 years ago

Thanks! It works! :D

RBogie commented 8 years ago

Good to hear!