Closed deksnergdf closed 3 years ago
Memory protection violation
Build OpenCV / FFmpeg with debug information (add -g
compiler option).
Stack trace (from native code, not Java) may help to google more information. Also check for "hs_err_pid.log" files.
Hi alalek!
Is it enough to add -g to the make command? Will it be forwarded to the compiler? Can you paste the syntax example?
d.
Can I use this syntax? make CC='gcc -g' CXX='g++ -g'
Flags should be specified on build configuration stage.
OpenCV: cmake -DCMAKE_CXX_FLAGS="-g" ...
FFmpeg: check ./configure --help
All examples from OpenCV site created in c++ are working.
Compiling FFMPEG and OpenCV with -g switch not helped me - maybe I dont know how can I use debug mode /where can I find log files/.
Do you have any idea what Can i check yet ?
I have FFmpeg in 3.1.1 version.
ffmpeg version 3.1.11 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 configuration: --cc='gcc -g' --cxx='g++ -g' libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 48.101 / 57. 48.101 libavformat 57. 41.100 / 57. 41.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 47.100 / 6. 47.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100
LD_DEBUG=files java -cp .:/root/opencv/opencv-3.4.1/build/bin/* -Djava.library.path=/root/opencv/opencv-3.4.1/build/lib -jar DET1.jar
/opt/vc/lib/libmmal_core.so
file=libmmal_core.so [0]; needed by /usr/lib/arm-linux-gnueabihf/libavcodec.so.57 [0]
System FFmpeg (avcodec) expects system "mmal_core" library, but some external binaries from /opt are loaded instead.
To prove this, replace:
-System.loadLibrary (Core.NATIVE_LIBRARY_NAME);
+System.loadLibrary ("avcodec");
Hi alalek
Thanke you for that you are trying help me.
After replace Core.NATIVE_LIBRARY_NAME -> "avcodec" I had exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no avcodec in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at det1.DET1.main(DET1.java:42)
I copied file /usr/lib/arm-linux-gnueabihf/libavcodec.so to ..\opencv-3.4.1\build\lib and command
System.loadLibrary ("avcodec");
was executed currect.
What now?
When I come back to System.loadLibrary (Core.NATIVE_LIBRARY_NAME); line give me the same effect.
D.
I copied file /usr/lib/arm-linux-gnueabihf/libavcodec.so to ..\opencv-3.4.1\build\lib and command
This is a bad idea really.
Similar to this:
# mv /opt/vc/lib /opt/vc/lib.disabled
# ldconfig
This is probably caused by https://bugs.debian.org/916222
The issue has been fixed in Debian packages. No action items on OpenCV side.
System information (version)
I would like to use the OpenCV video stream for face recognition. The project is to be in Java on Raspberry Pi. I use the NetBeans editor and remote debug mode. When executing the command
System.loadLibrary (Core.NATIVE_LIBRARY_NAME);
I have a mistake Memory protection violation.
When I compile OpenCV without FFMPEG there is no error. I read a lot, but nothing fixed me to solve the problem. The suggestion will also not help
building ffmpeg from src with "--disable-libopenmpt"
What else can I do ?