environment
Win10 x86_64: Normal
Linux x86_64: Error(Could not initialize class org.bytedeco.ffmpeg.global.avutil)
Linux version: Linux version 4.14.105-19-0008 (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC))
Requirement:
Obtain audio and video duration
gradle Dependencies:
List org_bytedeco = [
"org.bytedeco:javacv-platform:1.5.10"
]
Steps:
try load
@Component
@Slf4j
public class FFmpegFrameTryLoadRunner implements CommandLineRunner {
@Override
public void run(String... args) {
try {
long start = System.currentTimeMillis();
log.info("start:);
FFmpegFrameGrabber.tryLoad();
FFmpegFrameRecorder.tryLoad();
new MultimodalUtils().setTryLoadFlag(Boolean.TRUE);
log.info("finished", "cost:{}" + (System.currentTimeMillis() - start)));
} catch (Exception e) {
log.error("error", e);
}
}
}
java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_382]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_382]
at org.bytedeco.javacpp.Loader.load(Loader.java:1289) ~[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.avformat.Read_packet_Pointer_BytePointer_int.<clinit>(Read_packet_Pointer_BytePointer_int.java:45) ~[ffmpeg-6.1.1-1.5.10.jar:6.1.1-1.5.10]
at org.bytedeco.javacv.FFmpegFrameGrabber.<clinit>(FFmpegFrameGrabber.java:366) ~[javacv-1.5.10.jar:1.5.10]
at core.common.runner.FFmpegFrameTryLoadRunner.run(FFmpegFrameTryLoadRunner.java:35) ~[core-1.23.1116.jar:1.23.1116]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:768) [spring-boot-2.7.12.jar:2.7.12]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:752) [spring-boot-2.7.12.jar:2.7.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.7.12.jar:2.7.12]
at framework.biz.server.BaseServer.startServer(BaseServer.java:125) [sdk-biz-3.2.7.1.jar:3.2.7.1]
at framework.biz.server.BaseServer.service(BaseServer.java:139) [sdk-biz-3.2.7.1.jar:3.2.7.1]
at framework.biz.server.CoreServer.main(CoreServer.java:41) [core-1.23.1116.jar:1.23.1116]
Question:
Win10 runs the code normally, but Linux starts with an error(step1: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil). Why?
Is it because FFmpeg was not installed? I understand that the jar package already includes it, so there is no need to install FFmpeg separately
environment Win10 x86_64: Normal Linux x86_64: Error(Could not initialize class org.bytedeco.ffmpeg.global.avutil) Linux version: Linux version 4.14.105-19-0008 (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC))
Requirement: Obtain audio and video duration
gradle Dependencies:
Steps:
try load
Execution method
Runing: step1 error:
Question: Win10 runs the code normally, but Linux starts with an error(step1: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil). Why? Is it because FFmpeg was not installed? I understand that the jar package already includes it, so there is no need to install FFmpeg separately