[英]Java - Using Xuggler to create video from images
我下載了“ Xuggler 5.4” jar文件。 我嘗試使用它在Java中創建“ IContainer”,但出現錯誤:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.xuggle.ferry.JNILibrary.<clinit>(JNILibrary.java:42)
at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:14)
at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25)
at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1622)
at morph.VideoInfo.main(VideoInfo.java:14)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
這是我的代碼:
import com.xuggle.xuggler.ICodec;
import com.xuggle.xuggler.IContainer;
import com.xuggle.xuggler.IStream;
import com.xuggle.xuggler.IStreamCoder;
public class VideoInfo {
private static final String filename = "c:/myvideo.mp4";
public static void main(String[] args) {
IContainer container = IContainer.make();
}
}
如您所見, Xuggler對其他庫有一些依賴性。 使用Maven構建項目或下載缺少的依賴項並將其添加到項目中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.