Xuggler:UnsatisfiedLinkError:无法加载xuggle-xuggler:findLibrary返回null

时间:2014-08-23 18:56:20

标签: android audio video xuggler unsatisfiedlinkerror

我试图将视频转换为.mp3文件和Android设备。

经过很长一段时间的搜索和googleing(不确定它是否分别拼写如此拼写)我找到了Xuggler。 它是最合适的解决方案,因为我不能自己移植ffmepg(没有linux / ubuntu可用)而且JAVE给了我很多错误。所以我决定使用Xuggler。

我添加了 slf4j-api-1.7.7.jar xuggle-xuggler-3.4.1012.201001312056.jar (不是5.4的实际版本,因为我的android无法处理它;()作为外部图书馆

import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaViewer;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;

String source = this.storagePath + "/" + this.FileName + this.Video_encoding;
String target = this.storagePath + "/" + this.FileName + ".mp3";

IMediaReader mediaReader = ToolFactory.makeReader(source);
IMediaWriter mediaWriter = ToolFactory.makeWriter(target);
mediaReader.addListener(mediaWriter);
while (mediaReader.readPacket() == null) ;

我在这一行收到以下错误:

IMediaReader mediaReader = ToolFactory.makeReader(source);

这是我的堆栈跟踪:

08-23 20:27:32.783: E/AndroidRuntime(19678): FATAL EXCEPTION: AsyncTask #1
08-23 20:27:32.783: E/AndroidRuntime(19678): java.lang.RuntimeException: An error occured while executing doInBackground()
08-23 20:27:32.783: E/AndroidRuntime(19678):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.lang.Thread.run(Thread.java:856)
08-23 20:27:32.783: E/AndroidRuntime(19678): Caused by: java.lang.ExceptionInInitializerError
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at at.m4tho.youtubemp3sync.Async_DL.ConvertToMp3(Async_DL.java:194)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at at.m4tho.youtubemp3sync.Async_DL.doInBackground(Async_DL.java:70)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at at.m4tho.youtubemp3sync.Async_DL.doInBackground(Async_DL.java:1)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-23 20:27:32.783: E/AndroidRuntime(19678):    ... 5 more
08-23 20:27:32.783: E/AndroidRuntime(19678): Caused by: java.lang.ExceptionInInitializerError
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1457)
08-23 20:27:32.783: E/AndroidRuntime(19678):    ... 12 more
08-23 20:27:32.783: E/AndroidRuntime(19678): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load xuggle-xuggler: findLibrary returned null
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.lang.Runtime.loadLibrary(Runtime.java:365)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at java.lang.System.loadLibrary(System.java:535)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.ferry.JNILibraryLoader.loadLibrary0(JNILibraryLoader.java:265)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.ferry.JNILibraryLoader.loadLibrary(JNILibraryLoader.java:168)
08-23 20:27:32.783: E/AndroidRuntime(19678):    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
08-23 20:27:32.783: E/AndroidRuntime(19678):    ... 13 more

所以我浪费了太多时间寻找替代方案或一些修复方法,因此我问你。有没有人有一些想法如何解决这个问题?

如果这恰好是一个双重插件,有些人问了同样的事情,请给我一个链接。

抱歉我的英文不好;)

1 个答案:

答案 0 :(得分:0)

我以前见过UnsatisfiedLinkError,并且有几篇关于它的帖子可能有所帮助。但首先,请确保您为JVM使用正确版本的xuggler(例如32位xuggler用于32位java,64位用于64位java)。有关详细信息,请参阅this帖子。