Closed chenhao523 closed 4 months ago
"Excuse me, would it be sufficient if I only set up OpenCV and FFmpeg compatible with JavaCV specifically for the production environment?"
Yes, that works too, as long as the "org.bytedeco.javacpp.pathsFirst" system property is set to "true".
I have added System.setProperty("org.bytedeco.javacpp.pathsFirst", "true"); in my launcher class, but I am still encountering the same error.
In addition to setting System.setProperty("org.bytedeco.javacpp.pathsFirst", "true") in the launcher class, does merely installing FFmpeg and OpenCV on Ubuntu, along with configuring environment variables, suffice to specify the correct paths?
Probably not. Please set the "org.bytedeco.javacpp.logger.debug" system property to "true" to get more information on the console.
The JDK being used is version 8.
In the Windows operating system, selecting
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.javacpp.Loader
Debug: Loading library jnijavacpp
Debug: Failed to load for jnijavacpp: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path
Debug: Could not load Loader: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libva.so
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libdrm.so.2
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libva-drm.so
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavutil.so.58
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavutil.so
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.javacpp.Pointer
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.avutil.AVChannelLayout
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa95acc030,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa95acc030,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8320,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8320,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb89f0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb89f0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb87c0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb87c0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb87e0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb87e0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8800,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8800,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8820,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8820,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8840,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8840,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8860,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8860,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8880,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8880,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb88a0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb88a0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb88c0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb88c0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8940,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8940,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8960,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8960,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8980,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8980,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8a10,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8a10,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8a30,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8a30,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8a50,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8a50,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8a70,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8a70,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8a90,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8a90,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8ab0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8ab0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8ad0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8ad0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8af0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8af0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8b10,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8b10,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8b30,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8b30,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8b50,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8b50,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8b70,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8b70,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8b90,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8b90,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8bb0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8bb0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8bd0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8bd0,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8c20,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8c20,deallocatorAddress=0x7fa9580f8f40]]
Debug: Registering org.bytedeco.ffmpeg.avutil.AVChannelLayout[address=0x7faa94fb8c40,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb8c40,deallocatorAddress=0x7fa9580f8f40]]
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libswresample.so.4
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniswresample.so
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavcodec.so.60
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavcodec.so
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavformat.so.60
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavformat.so
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swscale
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swscale
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libswscale.so.7
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniswscale.so
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.ffmpeg.global.postproc
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.postproc
Debug: Loading library postproc
Debug: Failed to load for postproc@.56: java.lang.UnsatisfiedLinkError: no postproc in java.library.path
Debug: Loading library jnipostproc
Debug: Failed to load for jnipostproc: java.lang.UnsatisfiedLinkError: no jnipostproc in java.library.path
Debug: Loading class org.bytedeco.ffmpeg.global.swscale
Debug: Loading class org.bytedeco.ffmpeg.global.avfilter
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.ffmpeg.global.postproc
Debug: Loading class org.bytedeco.ffmpeg.global.swscale
Debug: Loading class org.bytedeco.ffmpeg.global.avfilter
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavfilter.so.9
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavfilter.so
Debug: Loading class org.bytedeco.ffmpeg.global.avdevice
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.ffmpeg.global.postproc
Debug: Loading class org.bytedeco.ffmpeg.global.swscale
Debug: Loading class org.bytedeco.ffmpeg.global.avfilter
Debug: Loading class org.bytedeco.ffmpeg.global.avdevice
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavdevice.so.60
Debug: Failed to load /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavdevice.so.60: java.lang.UnsatisfiedLinkError: /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libavdevice.so.60: libxcb-shm.so.0: cannot open shared object file: No such file or directory
Debug: Loading library avdevice
Debug: Failed to load for avdevice@.60: java.lang.UnsatisfiedLinkError: no avdevice in java.library.path
Debug: Loading /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavdevice.so
Debug: Failed to load /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavdevice.so: java.lang.UnsatisfiedLinkError: /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavdevice.so: libxcb-shm.so.0: cannot open shared object file: No such file or directory
Debug: Loading library jniavdevice
Debug: Failed to load for jniavdevice: java.lang.UnsatisfiedLinkError: no jniavdevice in java.library.path
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.ffmpeg.avformat.Write_packet_Pointer_BytePointer_int
Debug: Registering com.yh.rtspencode.utils.Recorder$WriteCallback[address=0x7faa94e38b10,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94e38b10,deallocatorAddress=0x7fa958034e80]]
Debug: Loading class org.bytedeco.javacpp.presets.javacpp
Debug: Loading class org.bytedeco.ffmpeg.global.avutil
Debug: Loading class org.bytedeco.ffmpeg.global.swresample
Debug: Loading class org.bytedeco.ffmpeg.global.avcodec
Debug: Loading class org.bytedeco.ffmpeg.global.avformat
Debug: Loading class org.bytedeco.ffmpeg.avformat.Seek_Pointer_long_int
Debug: Registering com.yh.rtspencode.utils.Recorder$SeekCallback[address=0x7faa94fb6920,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7faa94fb6920,deallocatorAddress=0x7fa958034a80]]
com.yh.rtspencode.utils.Recorder$Exception: Failed to load class com.yh.rtspencode.utils.Recorder
at com.yh.rtspencode.utils.Recorder.tryLoad(Recorder.java:111)
at com.yh.rtspencode.utils.Recorder.<clinit>(Recorder.java:1418)
at com.yh.rtspencode.service.FrameOperationService.initRecorder(FrameOperationService.java:66)
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 org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1737)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.yh.rtspencode.RtspEncodeApplication.main(RtspEncodeApplication.java:21)
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 org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.UnsatisfiedLinkError: no jniavdevice in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1863)
at java.lang.Runtime.loadLibrary0(Runtime.java:843)
at java.lang.System.loadLibrary(System.java:1134)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1832)
at org.bytedeco.javacpp.Loader.load(Loader.java:1423)
at org.bytedeco.javacpp.Loader.load(Loader.java:1234)
at org.bytedeco.javacpp.Loader.load(Loader.java:1210)
at org.bytedeco.ffmpeg.global.avdevice.<clinit>(avdevice.java:28)
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:1226)
at com.yh.rtspencode.utils.Recorder.tryLoad(Recorder.java:108)
... 35 more
Caused by: java.lang.UnsatisfiedLinkError: /root/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavdevice.so: libxcb-shm.so.0: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1820)
at java.lang.Runtime.load0(Runtime.java:782)
at java.lang.System.load(System.java:1098)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1779)
It's not trying to load libraries from your system, you need to call System.setProperty("org.bytedeco.javacpp.pathsFirst", "true") to do that
I resolved the error by commenting on these two lines of code: ( // Loader.load(org.bytedeco.ffmpeg.global.avdevice.class); // avdevice_register_all(); )
public static void tryLoad() throws Exception {
if (loadingException != null) {
throw loadingException;
} else {
try {
Loader.load(org.bytedeco.ffmpeg.global.avutil.class);
Loader.load(org.bytedeco.ffmpeg.global.swresample.class);
Loader.load(org.bytedeco.ffmpeg.global.avcodec.class);
Loader.load(org.bytedeco.ffmpeg.global.avformat.class);
Loader.load(org.bytedeco.ffmpeg.global.swscale.class);
// Register all formats and codecs
av_jni_set_java_vm(Loader.getJavaVM(), null);
avcodec_register_all();
av_register_all();
avformat_network_init();
// Loader.load(org.bytedeco.ffmpeg.global.avdevice.class);
// avdevice_register_all();
} catch (Throwable t) {
if (t instanceof Exception) {
throw loadingException = (Exception) t;
} else {
throw loadingException = new Exception("Failed to load " + FFmpegFrameGrabber.class, t);
}
}
}
}
Will this have any impact?
Make sure that your libraries can actually be found in the system PATH
No matter which version of JavaCV is packaged and running on the window, there is no problem. However, there are issues with both JavaCV 1.5.9 and JavaCV 1.5.10 on Ubuntu 16.04. How can I solve them?
pom(javacv1.5.9):
Error messages printed using Javacv1.5.9:
pom(javacv1.5.10):
Error messages printed using Javacv1.5.10: