简体   繁体   中英

Java - Using Xuggler to create video from images

I downloaded "Xuggler 5.4" jar file. I tried to use it to create a "IContainer" in java, but I get an error:

    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

This is my code:

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();

    }

}

As you can see Xuggler has some dependencies to other libraries. Build your project with maven or download the missing dependencies and add them to your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM