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

videoCapture.isOpened() always is false! #101

Open
4 tasks done
cgf120 opened this issue Sep 14, 2023 · 4 comments
Open
4 tasks done

videoCapture.isOpened() always is false! #101

cgf120 opened this issue Sep 14, 2023 · 4 comments

Comments

@cgf120
Copy link

cgf120 commented Sep 14, 2023

System Information

// example for java user
OpenCV version: 4.7.0
Operating System / Platform: Centos7 or Centos8 已安装ffmpeg
Compiler & compiler version: GLIBC 2.28
JAVA 1.8

Detailed description

videoCapture.isOpened() always is false!
使用centos8,videoCapture.isOpened()一直返回false,用centos7,报错defaultException异常:Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: /tmp/opencv_openpnp3982757882420087236/nu/pattern/opencv/linux/x86_64/libopencv_java460.so: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /tmp/opencv_openpnp3982757882420087236/nu/pattern/opencv/linux/x86_64/libopencv_java460.so)
代码:
OpenCV.loadLocally();
videoCapture = new VideoCapture(downFilePath); //downFilePath文件的绝对路径
videoCapture.open(downFilePath);
if (!videoCapture.isOpened()) {
return;
}

maven config:

<dependency>
  <groupId>org.openpnp</groupId>
  <artifactId>opencv</artifactId>
  <version>4.7.0-0</version>
</dependency>

Steps to reproduce

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)
@cgf120
Copy link
Author

cgf120 commented Sep 25, 2023

ok, it need install ffmpeg;

@kerry-weic
Copy link

Hello, ffmpeg has been installed for centos7 in my system. But still report this error

Exception in thread "main" java.lang.reflect.InvocationTargetException
        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:497)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:107)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/opencv_openpnp7807027642332807811/nu/pattern/opencv/linux/x86_64/libopencv_java470.so: /usr/lib64/libm.so.6: version `GLIBC_2.27' not found (required by /tmp/opencv_openpnp7807027642332807811/nu/pattern/opencv/linux/x86_64/libopencv_java470.so)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)
        at java.lang.Runtime.load0(Runtime.java:781)
        at java.lang.System.load(System.java:1098)
        at nu.pattern.OpenCV$LocalLoader.<init>(OpenCV.java:330)
        at nu.pattern.OpenCV$LocalLoader.<init>(OpenCV.java:326)
        at nu.pattern.OpenCV$LocalLoader$Holder.<clinit>(OpenCV.java:336)
        at nu.pattern.OpenCV$LocalLoader.getInstance(OpenCV.java:340)
        at nu.pattern.OpenCV.loadLocally(OpenCV.java:323)
        at com.test.SpringBootTest.main(SpringBootTest.java:15)
        ... 8 more

ffmpeg version info

[root@localhost test]# ffmpeg
ffmpeg version 3.4.13 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Hyper fast Audio and Video encoder

@thomedw
Copy link

thomedw commented Dec 11, 2023

Hi,

This opencv was built with ffmpeg disabled.

@fiorenzino
Copy link

Hi,

could be re-builded with ffmpeg enabled?
To streaming video that's mandatary...

(or can you suggest how to build with ffmpeg?)

best regards

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

No branches or pull requests

4 participants