web-dev-qa-db-fra.com

Compilateur ouvert avec Gstreamer, ne trouve pas GStreamer

Je veux créer ouvertement avec le support GStreamer.

J'ai construit GStreamer à partir des sources (version 1.8.1) en suivant ce guide: http://kacianka.at/?p=145 J'ai le dossier 'gstreamer_build' sur mon répertoire de base et il contient le dossier 'bin' avec ceux-ci:

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

J'ai ce chemin ajouté à ma variable d'environnement PATH.

Quand j'utilise cmake comme:

cmake -D CMAKE_BUILD_TYPE = RELEASE -D CMAKE_INSTALL_PREFIX =/usr/local -D OPENDV_EXTRA_MODULES_PATH = ____.] ..

La sortie suivante indique clairement que gstreamer n’a pas été trouvé:

-- 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

et ça:

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

Est-ce que quelqu'un peut m'aider avec ça?

10
Asymptote

J'ai eu le même problème.

gstreamer-base correspond à libgstbase-1.0.so (ou libgstbase-0.10.so), trouvée dans le package libgstreamer1.0-0 (ou libgstreamer0.10-0 , selon le cas peut être). Ci-dessous, nous installons le paquet '-dev'.

Les autres bibliothèques (libgst-video, libgst-app, libgst-riff, libgst-pbutils) que j'ai trouvées dans le paquet libgstreamer-plugins-base1.0-dev (encore une fois, remplacez la version que vous souhaitez utiliser, soit v0.1, ou v1.0).

Par conséquent, la commande suivante doit être utilisée pour installer les dépendances manquantes:

Sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

Répétez la commande cmake, en purifiant éventuellement au préalable le contenu du répertoire de construction.

14
Dan0

Sous Windows, il n'y a pas "Sudo apt install ...". Tous les chemins d'accès étaient également définis dans ma variable d'environnement PATH, et j'avais toujours le même problème. J'ai ce travail après avoir défini les options suivantes de CMake:

  1. définir uniquement l'option "WITH_GSTREAMER" sur True, "WITH_GSTREAMER_0_10" DOIT ÊTRE FAUX
  2. ajoutez une nouvelle entrée "GSTREAMER_DIR" = (chemin d'accès à gstreamer) pour moi, il s'agissait de "C: /gstreamer/1.0/x86_64" J'ai trouvé cette solution ici

Ma version OpenCV: 3.4.3

0
Butterfly

Ce qui précède a fonctionné pour moi si vous développez uniquement une application Gstreamer

# GStreamer CMake building
cmake_minimum_required(VERSION 3.3)
project(GStreamerHello)

set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig REQUIRED)
if ( NOT (PKGCONFIG_FOUND))
      message(FATAL_ERROR "Please Install PPkgConfig: CMake will Exit")
endif()
pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.8)
if ( NOT (GST_FOUND))
      message(FATAL_ERROR "Please Install Gstreamer Dev: CMake will Exit")
endif()
set(ENV{PKG_CONFIG_PATH})

include_directories("${GST_INCLUDE_DIRS}")

link_libraries(${GST_LIBRARIES})

add_executable(gstreamerSrvc  src/hello_gstreamer.cc)
add_dependencies(gstreamerSrvc vsphere_header )
target_link_libraries(gstreamerSrvc ${GST_LIBRARIES}  )

Remarque - Si vous avez besoin d'un docker dev pour GStreamer, celui-ci est disponible ci-dessous. et pour votre question, il comprend également les étapes de compilation avec OpenCV: Plus de détails sur https://medium.com/techlogs/compiling-opencv-for-cuda-for-yolo-and-other -cnn-libraries-9ce427c00ff8

FROM nvidia/cuda
# This is a dev image, needed to compile OpenCV with CUDA
# Install  Gstreamer and OpenCV Pre-requisite libs
RUN  apt-get update -y && apt-get install -y \
            libgstreamer1.0-0 \
            gstreamer1.0-plugins-base \
            gstreamer1.0-plugins-good \
            gstreamer1.0-plugins-bad \
            gstreamer1.0-plugins-ugly \
            gstreamer1.0-libav \
            gstreamer1.0-doc \
            gstreamer1.0-tools \
            libgstreamer1.0-dev \
            libgstreamer-plugins-base1.0-dev
RUN  apt-get update -y && apt-get install -y  pkg-config \
 zlib1g-dev  libwebp-dev \
 libtbb2 libtbb-dev  \
 libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev \
 cmake
RUN apt-get install -y \
  autoconf \
  autotools-dev \
  build-essential \
  gcc \
  git
ENV OPENCV_RELEASE_TAG 3.4.5
RUN git clone https://github.com/opencv/opencv.git /var/local/git/opencv
RUN cd /var/local/git/opencv && \
  git checkout tags/${OPENCV_RELEASE_TAG} 
RUN mkdir -p /var/local/git/opencv/build && \
     cd /var/local/git/opencv/build $$ && \
    cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_PNG=OFF -D \
    BUILD_TIFF=OFF -D BUILD_TBB=OFF -D BUILD_JPEG=ON \
    -D BUILD_JASPER=OFF -D BUILD_ZLIB=ON -D BUILD_EXAMPLES=OFF \
    -D BUILD_opencv_Java=OFF -D BUILD_opencv_python2=ON \
    -D BUILD_opencv_python3=OFF -D ENABLE_NEON=OFF -D WITH_OPENCL=OFF \
    -D WITH_OPENMP=OFF -D WITH_FFMPEG=OFF -D WITH_GSTREAMER=ON -D WITH_GSTREAMER_0_10=OFF \
    -D WITH_CUDA=ON -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -D WITH_GTK=ON \
    -D WITH_VTK=OFF -D WITH_TBB=ON -D WITH_1394=OFF -D WITH_OPENEXR=OFF \
     -D CUDA_Arch_BIN=6.0 6.1 7.0 -D CUDA_Arch_PTX="" -D INSTALL_C_EXAMPLES=OFF -D INSTALL_TESTS=OFF ..
RUN  cd /var/local/git/opencv/build && \ 
      make install
# Install other tools you need for development
0
Alex Punnen