Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Enabling GStreamer source in G API
Anastasiya(Asya) Pronina edited this pageMay 9, 2023 ·4 revisions
As a first step, you need to install the following dependencies:
$ sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-{base,good,bad}Secondly, you need to launch OpenCV cmake with an extra option specified:
$ cmake /path-to-opencv -DOPENCV_GAPI_GSTREAMER=ON
After completing these steps, you should see the following in the cmake output:
-- Checkingfor module'gstreamer-base-1.0'-- Found gstreamer-base-1.0, version 1.16.3-- Checkingfor module'gstreamer-app-1.0'-- Found gstreamer-app-1.0, version 1.16.3-- Checkingfor module'gstreamer-riff-1.0'-- Found gstreamer-riff-1.0, version 1.16.3-- Checkingfor module'gstreamer-pbutils-1.0'-- Found gstreamer-pbutils-1.0, version 1.16.3-- Checkingfor module'gstreamer-video-1.0'-- Found gstreamer-video-1.0, version 1.16.3-- Checkingfor module'gstreamer-audio-1.0'-- Found gstreamer-audio-1.0, version 1.16.3
And, also the following:
-- Video I/O:-- ...-- GStreamer: YES (1.16.3)-- ...
When you build G-API with GStreamer support, tests for streaming via GStreamerSource are enabled. However, some of them require test data fromopencv_extra repository. So, to launch all the tests successfully, you need:
- Cloneopencv_extra repository:
$ git clone https://github.com/opencv/opencv_extra.git
- SetOPENCV_TEST_DATA_PATH environment variable:
$export OPENCV_TEST_DATA_PATH=/path-to-opencv_extra/testdata - Run tests with*GStreamer* filter:
$ ./path-to-opencv-bin/opencv_test_gapi --gtest_filter=*GStreamer*
After completing these steps, you should see that all of tests pass.For example:

You may, however, notice some warnings during execution, like these ones:

or

Please don't worry, they are expected!
© Copyright 2019-2025, OpenCV team