Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (49)

Sur d’autres sites (8917)

  • Exception in thread "main" java.lang.NoClassDefFoundError : Could not initialize class org.bytedeco.javacpp.avutil"

    12 décembre 2016, par Ajinkya
    public static class AVFormatContext extends Pointer {
       static { Loader.load(); }
       /** Default native constructor. */
       public AVFormatContext() { super((Pointer)null); allocate(); }
       /** Native array allocator. Access with {@link Pointer#position(long)}. */
       public AVFormatContext(long size) { super((Pointer)null); allocateArray(size); }
       /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
       public AVFormatContext(Pointer p) { super(p); }
       private native void allocate();
       private native void allocateArray(long size);
       @Override public AVFormatContext position(long position) {
           return (AVFormatContext)super.position(position);
    }

    I’ve tried to run a java application with an FFMmpegFrameGrabber while trying to run on windows. However same jar file runs on linux with no exceptions.

    I have included javacpp and javacv jars .

    However while running on windows I am getting this error
    main" java.lang.NoClassDefFoundError : Could not initialize class org.bytedeco.javacpp.avutil"

    Stacktrace of exception

    Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize
    class org.bytedeco.javacpp.avutil
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Unknown Source)
           at org.bytedeco.javacpp.Loader.load(Loader.java:413)
           at org.bytedeco.javacpp.Loader.load(Loader.java:381)
           at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:
    2719)
           at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber
    .java:391)
           at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:
    385)
           at testffmpeg.NewStreamer.StartandRestart(NewStreamer.java:191)
           at testffmpeg.NewStreamer.<init>(NewStreamer.java:95)
           at testffmpeg.NewStreamer.main(NewStreamer.java:91)
    </init></clinit>
  • Exception in thread "main" java.lang.UnsatisfiedLinkError : no jniavutil in java.library.path

    29 novembre 2016, par tpm900

    I am trying to split a video into frames using FFmpegFrameGrabber (using code I have seen in tutorials) but am getting an exception as follows :

    The code :

    public BufferedImage getNextFrame() {
       FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber("resources/WebPage.mp4");
       BufferedImage bufferedImage = null;
       opencv_core.IplImage i;
       try {
           fFmpegFrameGrabber.start();
           i = fFmpegFrameGrabber.grab();
           bufferedImage = i.getBufferedImage();
       } catch (Exception e) {
           e.printStackTrace();
           try {
               fFmpegFrameGrabber.stop();
           } catch (Exception e1) {
               e1.printStackTrace();
           }
       }
       return bufferedImage;
    }

    The stack trace :

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
    at com.googlecode.javacpp.Loader.load(Loader.java:489)
    at com.googlecode.javacpp.Loader.load(Loader.java:431)
    at com.googlecode.javacv.cpp.avutil.<clinit>(avutil.java:76)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.googlecode.javacpp.Loader.load(Loader.java:453)
    at com.googlecode.javacv.cpp.avcodec.<clinit>(avcodec.java:87)
    at com.googlecode.javacv.FFmpegFrameGrabber.<init>(FFmpegFrameGrabber.java:73)
    at MP4VideoCodec.getNextFrame(MP4VideoCodec.java:16)
    at MP4VideoCodec.<init>(MP4VideoCodec.java:12)
    at main.main(main.java:7)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
    Caused by: java.lang.UnsatisfiedLinkError: no avutil in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
    at com.googlecode.javacpp.Loader.load(Loader.java:481)
    ... 15 more
    </init></init></clinit></clinit>

    How do I correct this exception ?

  • Revision ab21378a2e : Merge "Get rid of bashisms in the main build scripts"

    15 août 2013, par James Zern

    Merge "Get rid of bashisms in the main build scripts"