Centos 7 building: many missing packages e.g. videodev.h, libavutil building
I have followed the instructions at "Install OpenCV 3.1 and Python 2.7 on CentOS 7" (At www.computervisiononline.com , "my karma is insufficient to publish links" ) but am getting many errors building OpenCV on Centos 7.
I looked for and installed any similar packages I could find (a lot) but am still getting most of the errors.
$ sudo yum install gstreamer1
$ sudo yum install gstreamer1-libav
$ sudo yum install gstreamer1-plugins-base-devel
$ sudo yum install libavutil libswscale libavresample ffmpeg libgphoto2 gphoto2
sudo yum install vtk ...
Cmake command and errors:
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D BUILD_OPENCV_PYTHON2=ON ..
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
-- package 'libavcodec' not found ...
-- checking for module 'libavformat'
-- package 'libavformat' not found
-- checking for module 'libavutil'
-- package 'libavutil' not found
-- checking for module 'libswscale'
-- package 'libswscale' not found
-- checking for module 'libavresample'
-- package 'libavresample' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - not found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'libgphoto2'
-- package 'libgphoto2' not found
. . .
-- Configuring incomplete, errors occurred! See also "/opt/opencv/opencv/build/CMakeFiles/CMakeOutput.log". See also "/opt/opencv/opencv/build/CMakeFiles/CMakeError.log".
CMakeError.log ends with
Building C object CMakeFiles/cmTryCompileExec3179090135.dir/CheckIncludeFile.c.o
/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec3179090135.dir/CheckIncludeFile.c.o -c /opt/opencv/opencv/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/opt/opencv/opencv/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:29: fatal error: ffmpeg/avformat.h: No such file or directory
#include <ffmpeg/avformat.h>
^
compilation terminated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec3179090135.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/opt/opencv/opencv/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3179090135/fast] Error 2
Full output of Cmake (Added Feb 14 10:50 am pst)
$ cd /opt/opencv/opencv/build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D BUILD_OPENCV_PYTHON2=ON ..
-- The CXX compiler identification is GNU 4.8.5
-- The C compiler identification is GNU 4.8.5
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 48 (408)
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing ...
It is only warning send by cmake
I don't think so. The build ends with " Configuring incomplete, errors occurred! " . See more error messages I added to end of original post. I can't find any object libraries or executables. The next step in the instructions is
which fail because there isn't even a Makefile in the build directory. (I assume the CMake build creates it).
Delete cmakecache.txt. run your cmake command. If problem persist uninstalled ffmpeg and reinstall it and test your ffmpef installation (check ffmpeg/avformat.h)
Thanks for ideas. I deleted CMakeCache.txt and the build got further. But it ended with the same or similar errors. (full output posted in original msg). Then I did
but "testing ffmpeg installation", I could not find an avformat.h file,
Search all files in package ffmpeg:
in fact no .h files in the package
not in any package in the repos I use:
(max comm. len
finishing previous comment which exceeded maximum length--
I cannot help you more I'm not at all a linux expert. If you want to use opencv you can disable ffmpeg : WITH_FFMPEG=OFF and try to solve later ffmpeg problem