Ask Your Question
1

cmake not picking GStreamer on Ubuntu

asked 2016-06-06 06:01:50 -0600

asymptote gravatar image

Hi

I want to build opencv with GStreamer support.

I built the GStreamer from source (version 1.8.1) following this guide: http://kacianka.at/?p=145 I have 'gstreamer_build' folder at my home directory and it contains 'bin' folder with these:

gst-device-monitor-1.0 gst-discoverer-1.0 gst-inspect-1.0 gst-launch-1.0 gst-play-1.0 gst-stats-1.0 gst-typefind-1.0 orc-bugreport orcc

I have this path added to my environment variable PATH.

When I use cmake like:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_opencv_python3=ON -D WITH_GSTREAMER=ON -D WITH_FFMPEG=OFF ..

I get the following output clearly indicating that gstreamer is not found:

-- checking for module 'gstreamer-base-1.0'
--   package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
--   package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
--   package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
--   package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
--   package 'gstreamer-pbutils-1.0' not found
-- checking for module 'gstreamer-base-0.10'
--   package 'gstreamer-base-0.10' not found
-- checking for module 'gstreamer-video-0.10'
--   package 'gstreamer-video-0.10' not found
-- checking for module 'gstreamer-app-0.10'
--   package 'gstreamer-app-0.10' not found
-- checking for module 'gstreamer-riff-0.10'
--   package 'gstreamer-riff-0.10' not found
-- checking for module 'gstreamer-pbutils-0.10'
--   package 'gstreamer-pbutils-0.10' not found

and this:

Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       resample:                  NO
--       gentoo-style:              NO
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    Using libv4l1 (ver 1.0.1) / libv4l2 (ver 1.0.1)
--     XIMEA:                       NO
--     Xine:                        NO
--     gPhoto2:                     NO

Can anyone help me with this?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2017-07-01 07:11:11 -0600

MrPilli gravatar image

I know this answer might be a little late but since your question is referenced. I Think it might help other peoples.

I've had the same problem has you and I found the solution.

You have to make sure that all GStreamer dependencies are installed

i found missing dependencies by typing the following command :

apt-file find gstreamer-video

if you don't have apt-file you can install it with

sudo apt-get install apt-file

it returned the following :

libgstreamer-plugins-base1.0-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gstreamer-video-1.0.pc

so that i deduced that i had to install libgstreamer-plugins-base1.0-dev.

the following command has all the missing dependencies for my configuration :

apt-get install libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-0-dev libgstreamer1.0 libgstreamer1.0dev libgstreamer-plugins-base1.0-dev libgtk-3-dev

Then when i try to build with the following command

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D WITH_GSTREAMER=ON ..

I've got the following output :

--     GStreamer:                   
--       base:                      YES (ver 1.4.4)
--       video:                     YES (ver 1.4.4)
--       app:                       YES (ver 1.4.4)
--       riff:                      YES (ver 1.4.4)
--       pbutils:                   YES (ver 1.4.4)

I hope this will help some people.

edit flag offensive delete link more

Comments

MrPilli's answer is quite good, but has a few incorrect characters in the command. This is the command to install Gstreamer 1.x build dependencies for OpenCV 2 or 3 on Debian / Ubuntu / Linux Mint: sudo apt-get install libgstreamer1.0 libgstreamer1.0-dev libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev

Shervin Emami gravatar imageShervin Emami ( 2017-09-18 21:27:08 -0600 )edit

I encountered the same problem with Ubuntu 18.10 (Gstreamer 1.14.1, Python3.6), even with pre-requisite package instalation and the above cmake command. Python3 doesn't enable GStreamer yet. Recent change of OpenCV5 folder uses may break something. What do I miss? some ldconfig step? some so symbolic linking step?

yo-sato gravatar imageyo-sato ( 2018-12-16 02:29:34 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2016-06-06 06:01:50 -0600

Seen: 10,568 times

Last updated: Jul 01 '17