I have been using OpenCV for a while. However, I recently changed my system to a cluster where I do not have any administrator permission. The problem is this:
I installed FFMPEG in my home folder (the latest stable version is available on the ffmpeg website). I installed it in $ HOME, and so library files are installed in $ HOME / lib. For more information, I compiled FFMPEG with the following parameters:
./configure --prefix=$HOME --enable-shared --enable-pic
Then I downloaded the latest stable version of OpenCV 3.0.0 and configured it using ccmake. When I try make -j8
, it gives me the following error.
Scanning dependencies of target opencv_videoio [ 63%] [ 63%] [ 63%] [ 63%] [ 63%] [ 63%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap.cpp.o Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_images.cpp.o Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.o Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o In file included from /home/uujjwal/libraries/opencv-nogpu/opencv-3.0.0/modules/videoio/src/cap_ffmpeg.cpp:45:0: /home/uujjwal/libraries/opencv-nogpu/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1546:71: error: use of enum 'AVCodecID' without previous declaration /home/uujjwal/libraries/opencv-nogpu/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1556:83: error: use of enum 'AVCodecID' without previous declaration make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs....
However, without ffmpeg support, it works fine. However, I need ffmpeg support due to the nature of my work.
While trying to solve the problem, I tried to install OpenCV 2.4.11, but also gave this error. The latest version of GIT does not give me this error, but rather an error, part of which looks like
Linking CXX shared library ../../lib/libopencv_highgui.so /usr/bin/ld: /home/matheus/ffmpeg_build/lib/../lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used
I inserted the above error from another unresolved issue on the Internet, and so the folder names are different, but the move error is exactly the same.
While trying to solve the problem, I searched and found the following link http://answers.opencv.org/question/12597/build-problems-for-opencv-241-with-ubuntu-1204-lts/
However, one of the answers mentioned changing some lines in the cap_ffmpeg_impl.hpp file. I tried to do this, but either I cannot do it right, or something else is wrong and it is not working. Exact line numbers and exact changes are not mentioned, so it's hard for me to change things and be sure.
I am using Fedora 19 (Schrodinger Cat) as the operating system. I hope the details of my question are clear, and I hope the community has committed me with a good answer.
Relations Ujjwal