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);
}
尝试在Windows上运行时,我尝试使用FFMmpegFrameGrabber运行java应用程序。但是同样的jar文件在linux上运行,没有例外。
我已经加入了javacpp和javacv罐子。
然而,当在Windows上运行时,我收到此错误 main“java.lang.NoClassDefFoundError:无法初始化类org.bytedeco.javacpp.avutil”
异常的堆栈跟踪
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)