cancel
Showing results for 
Search instead for 
Did you mean: 

What is the highest version of opencv compatible with the gstreamer library included in this SDK?

babai50
Associate

I have transplanted the latest opencv-4.8.1 on the STM32MP135F-DK Discovery Board and run a program to capture video stream from a camera on the borad.
I found if I cmake the opencv-4.8.1 source code with "-DWITH_GSTREAMER=ON -DBUILD_GSTREAMER=ON",and when I am getting the camera data stream in the test program, the gstreamer library on the board reports the following error.

(opencv_camera:2589): GStreamer-CRITICAL **: 19:26:41.671: gst_sample_get_caps: assertion 'GST_IS_SAMPLE (sample)' failed
[ERROR:0@95.876] global cap_gstreamer.cpp:925 retrieveVideoFrame GStreamer: gst_sample_get_caps() returns NULL


Then I cmake the opencv-4.8.1 source code with "-DWITH_GSTREAMER=OFF -DBUILD_GSTREAMER=OFF", the errors are gone and the test program runs normally.

I think it might be that the opencv I compiled is not compatible with the gstreamer library included in the SDK.

Is my understanding right?

 

the version of the opencv I compiled:

opencv-4.8.1

the version of the gstreamer library included in the SDK:

libgstreamer-1.0.so.0.2200.0

SDK:

en.SDK-x86_64-stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21.tar.gz

My opencv cmake command

cmake -D WITH_IPP=OFF \
      -D BUILD_IPP=OFF \
      -D WITH_ADE=OFF \
      -D BUILD_ADE=OFF \
      -D WITH_GSTREAMER=ON \
      -D BUILID_GSTREAMER=ON \
      -D CMAKE_INSTALL_PREFIX=../install \
      ..

My test program

#include <iostream>

#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

int main()
{
    VideoCapture cap(0);

    if (!cap.isOpened())
    {
        cout << "could not open the camera" << endl;
        return -1;
    }

    namedWindow("camera", WINDOW_AUTOSIZE);

    while (true)
    {
        Mat frame;

        cap >> frame;

        if (frame.empty())
            break;

        imshow("camera", frame);

        if (waitKey(30) == 'q')
            break;
    }

    cap.release();
    destroyAllWindows();

    return 0;
}

 

1 REPLY 1
PatrickF
ST Employee

HI @babai50 ,

I have found v4.7.x is mention in this page : https://wiki.st.com/stm32mpu/wiki/Category:X-LINUX-AI_expansion_package#Contents

Regards

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.