Install gstreamer support for opencv python package
I am having trouble enabling gstreamer support for the opencv python package (cv2). gstreamer1.0 is running fine as a standalone and I have manually built the cv2 python package from the OpenCV sources.
import cv2
print(cv2.getBuildInformation())
prints:
Video I/O:
...
GStreamer: NO
...
I ensured WITH_GSTREAMER was set to ON during ccmake. Not sure whats left for me to try. Can anyone help?
Here is a link to my related stack overlflow post.
Thanks!
Edit: I did a
cmake .. -DWITH_GSTREAMER=ON
to have some cmake output that I can post. Not sure if the command I am using will actually replicate what I have done using ccmake. Anyway, here is the output
-- Looking for ccache - not found
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- 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 '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
-- Looking for linux/videodev.h
-- 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 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
-- found Intel IPP (ICV version): 2019.0.0 [2019.0.0 Gold]
-- at: /home/basti/Downloads/opencv-3.4.5/build/3rdparty/ippicv/ippicv_lnx/icv
-- found Intel IPP Integration Wrappers sources: 2019.0.0
-- at: /home/basti/Downloads/opencv-3.4.5/build/3rdparty/ippicv/ippicv_lnx/iw
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY)
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- OpenCV Python: during development append to PYTHONPATH: /home/basti/Downloads/opencv-3.4.5/build/python_loader
--
-- General configuration for OpenCV 3.4.5 =====================================
-- Version control: unknown
--
-- Platform:
-- Timestamp: 2019-01-08T15:50:13Z
-- Host: Linux 4.13.0-36-generic x86_64
-- CMake: 3.5.1
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
--
-- CPU/HW features:
-- Baseline: SSE SSE2 SSE3
-- requested: SSE3
-- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX ...
could your append the cmake output to your question ?
I am using ccmake to generate my cmakelist.txt. There is not really any output I could post. do you want me to screen shot all config options, instead?
Alright, nevermind. I got it. Thanks for the comment about cmake output! The output shows the problem. I'll post the solution in a sec.
no, it's all ok, like it is, thanks for the edit !
do you see this part: ?
no idea, how you installed gstreamer, but it did not find anything useful ;(
did you actually install
gstreamer-dev
? (we need the headers / libs, too !)ahh jeeez. I just took a bunch of time answering my own question. new users have to wait 2 days to do it though. I'll post it in my related stack overflow and make sure to link this post here, too. You're on point about your find! I had both WITH_GSTREAMER and WITH_GSTREAMER_0_10 set to ON during installation. Cmake seems to prefer the latter, but I don't have gstreamer0.10 installed. I am running gstreamer1.0 and thus must enable only the WITH_GSTREAMER option during cmake. Again, thanks for the immediate help =)