Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there any working tutorial to show how to build OpenCV on Linux (CentOS) with GStreamer?

I am trying to build OpenCV on CentOS operating system with GStreamer, but cmake cannot find the packages for GStreamer. Here are two questions:

  1. Exactly what libs and software needed for building OpenCV on Linux, such as g++, and so on, by this question I mean that I don't want to install any extra and not necessary software on the system?
  2. How to install the GStreamer and configure it with OpenCV

Heres is what I have done so far: I have installed CentOS 7, and searching for this topic on the internet and did something these operations:

  • yum update to update the system (as said on the internet, I think it is not a good solution)
  • When the update was done, start building OpenCV

Everything goes well, but when looking at the cmake log, here said that cannot found GStreamer and so on. It is the log output: I put only the important parts

> The CXX compiler identification is GNU
> 4.8.5 The C compiler identification is GNU 4.8.5 Check for working CXX
> compiler: /usr/bin/c++ Check for
> working CXX compiler: /usr/bin/c++ --
> works Detecting CXX compiler ABI info
> Detecting CXX compiler ABI info - done
> Detecting CXX compile features
> Detecting CXX compile features - done
> Check for working C compiler:
> /usr/bin/cc Check for working C
> compiler: /usr/bin/cc -- works
> Detecting C compiler ABI info
> Detecting C compiler ABI info - done
> Detecting C compile features Detecting
> C compile features - done

Checking for module 'gtk+-3.0'
  No package 'gtk+-3.0' found
Checking for module 'gtk+-2.0'
  No package 'gtk+-2.0' found
Checking for module 'gthread-2.0'
  No package 'gthread-2.0' found
Checking for module 'gstreamer-base-1.0'
  No package 'gstreamer-base-1.0' found
Checking for module 'gstreamer-video-1.0'
  No package 'gstreamer-video-1.0' found
Checking for module 'gstreamer-app-1.0'
  No package 'gstreamer-app-1.0' found
Checking for module 'gstreamer-riff-1.0'
  No package 'gstreamer-riff-1.0' found
Checking for module 'gstreamer-pbutils-1.0'
  No package 'gstreamer-pbutils-1.0' found
Checking for module 'gstreamer-base-0.10'
  No package 'gstreamer-base-0.10' found
Checking for module 'gstreamer-video-0.10'
  No package 'gstreamer-video-0.10' found
Checking for module 'gstreamer-app-0.10'
  No package 'gstreamer-app-0.10' found
Checking for module 'gstreamer-riff-0.10'
  No package 'gstreamer-riff-0.10' found
Checking for module 'gstreamer-pbutils-0.10'
  No package 'gstreamer-pbutils-0.10' found
Checking for module 'libdc1394-2'
  No package 'libdc1394-2' found
Checking for module 'libdc1394'
  No package 'libdc1394' found

Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
  No package 'libavcodec' found
  No package 'libavformat' found
  No package 'libavutil' found
  No package 'libswscale' found
Checking for module 'libavresample'
  No package 'libavresample' found
Checking for module 'libgphoto2'
  No package 'libgphoto2' found

General configuration for OpenCV 3.3.1-dev =====================================
  Version control:               unknown

  Platform:
    Timestamp:                   2017-11-23T15:53:39Z
    Host:                        Linux 3.10.0-693.5.2.el7.x86_64 x86_64
    CMake:                       3.10.0-rc3
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2
      SSE4_1 (3 files):          + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (2 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (9 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++  (ver 4.8.5)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden   -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden   -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections  -msse -msse2 -msse3 -fvisibility=hidden   -DNDEBUG
    C flags (Debug):             -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 -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections  -msse -msse2 -msse3 -fvisibility=hidden   -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):
    Linker flags (Debug):
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:          dl m pthread rt
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann highgui imgcodecs imgproc java ml objdetect photo shape stitching superres ts video videoio videostab
    Disabled:                    js world
    Disabled by dependency:      -
    Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python2 python3 viz
    Applications:                tests perf_tests apps
    Documentation:               NO
    Non-free algorithms:         NO

  GUI: 
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.8)
    JPEG:                        libjpeg (ver 90)
    WEBP:                        build (ver encoder: 0x020e)
    PNG:                         build (ver 1.6.24)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      NO
      avcodec:                   NO
      avformat:                  NO
      avutil:                    NO
      swscale:                   NO
      avresample:                NO
    GStreamer:                   NO
    libv4l/libv4l2:              NO
    v4l/v4l2:                    linux/videodev2.h
    gPhoto2:                     NO

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2017.0.3 [2017.0.3]
           at:                   /home/adil/Desktop/opencv/build/3rdparty/ippicv/ippicv_lnx
    Intel IPP IW:                sources (2017.0.3)
              at:                /home/adil/Desktop/opencv/build/3rdparty/ippicv/ippiw_lnx
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO

  NVIDIA CUDA:                   NO

  OpenCL:                        YES (no extra features)
    Include path:                /home/adil/Desktop/opencv/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python (for build):            /usr/bin/python2.7

  Java:
    ant:                         /bin/ant (ver 1.9.2)
    JNI:                         /usr/lib/jvm/java/include /usr/lib/jvm/java/include/linux /usr/lib/jvm/java/include
    Java wrappers:               YES
    Java tests:                  YES

  Matlab:                        NO

  Install to:                    /usr/local
-----------------------------------------------------------------

Configuring done