Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javacv 1.5.10 java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil #2212

Closed
Love122 opened this issue Apr 10, 2024 · 7 comments

Comments

@Love122
Copy link

Love122 commented Apr 10, 2024

run env {"java version":"1.8.0u192","nginx version":"openresty/1.9.7.3","tomcat version":"Tomcat/8.5.42","linux version":"CentOS release 6.6 (Final)","":"v3tomcat"}

export error code:
File sourceFile = new File(fileName);
frameGrabber = FFmpegFrameGrabber.createDefault(sourceFile);

trace log :
Exception in thread "pool-23-thread-1" java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:1289)
at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
at org.bytedeco.javacpp.Loader.load(Loader.java:1210)
at org.bytedeco.ffmpeg.avformat.Read_packet_Pointer_BytePointer_int.(Read_packet_Pointer_BytePointer_int.java:45)
at org.bytedeco.javacv.FFmpegFrameGrabber.(FFmpegFrameGrabber.java:366)
at com.jd.ershou.oss.VideoHelper.convert2Mp4(VideoHelper.java:256)
at com.jd.ershou.oss.VideoHelper.start(VideoHelper.java:187)
at com.jd.ershou.sns.web.controller.FileUploadController$1.run(FileUploadController.java:406)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

@nocarethancare
Copy link

i have the same problem 1.5.9 is ok

@Love122
Copy link
Author

Love122 commented Apr 10, 2024

I find some function load by :
Loader.load(avutil.class);
Loader.load(swresample.class);
Loader.load(avcodec.class);
But also had error,like that :
java.lang.UnsatisfiedLinkError: no jniavutil in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) ~[?:1.8.0_60]
at java.lang.Runtime.loadLibrary0(Runtime.java:870) ~[?:1.8.0_60]
at java.lang.System.loadLibrary(System.java:1122) ~[?:1.8.0_60]
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832) ~[javacpp-1.5.10.jar:1.5.10]
at org.bytedeco.javacpp.Loader.load(Loader.java:1423) ~[javacpp-1.5.10.jar:1.5.10]
at org.bytedeco.javacpp.Loader.load(Loader.java:1234) ~[javacpp-1.5.10.jar:1.5.10]
at org.bytedeco.javacpp.Loader.load(Loader.java:1210) ~[javacpp-1.5.10.jar:1.5.10]
at org.bytedeco.ffmpeg.global.avutil.(avutil.java:14) ~[ffmpeg-6.1.1-1.5.10.jar:6.1.1-1.5.10]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_60]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_60]
at org.bytedeco.javacpp.Loader.load(Loader.java:1289) ~[javacpp-1.5.10.jar:1.5.10]
Caused by: java.lang.UnsatisfiedLinkError: /home/admin/.javacpp/cache/ffmpeg-6.1.1-1.5.10-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavutil.so: libdrm.so.2: Unable to open shared object file: No file or directory available

Please help me fix this peoblem,thanks,in my mac book run all well,but in linux centos7 always export this error

@Love122
Copy link
Author

Love122 commented Apr 10, 2024

someone tell me, In Linux, it is necessary to compile the corresponding so file,right ? @paul-hammant

@Love122
Copy link
Author

Love122 commented Apr 10, 2024

@saudet help ~~

@saudet
Copy link
Member

saudet commented Apr 10, 2024

Please try again with Ubuntu

@saudet
Copy link
Member

saudet commented Apr 10, 2024

Duplicate of bytedeco/javacpp-presets#1379

@saudet saudet marked this as a duplicate of bytedeco/javacpp-presets#1379 Apr 10, 2024
@saudet saudet closed this as completed Apr 10, 2024
@Love122
Copy link
Author

Love122 commented Apr 11, 2024

thanks, I use 1.5.9 version and os mirror base on centos7 install ffmpeg 4.3.1, can fix this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants