Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Yocto Linux中带Opencv的Gstreamer_C++_Linux_Opencv_Gstreamer_Yocto - Fatal编程技术网

C++ Yocto Linux中带Opencv的Gstreamer

C++ Yocto Linux中带Opencv的Gstreamer,c++,linux,opencv,gstreamer,yocto,C++,Linux,Opencv,Gstreamer,Yocto,我有两个Yocto构建在不同的处理器上运行,我正在尝试用GStreamer编写一个OpenCV代码,其中一个将发送数据包,另一个将接收数据包。我面临的问题是,在接收器脚本中,程序被“VideoCapture”功能卡住,无法进一步执行。接收器与HDMI屏幕相连,在运行目标文件后,监视器上没有变化。下面我附上代码 #include <iostream> #include <opencv2/core.hpp> #include <opencv2/highgui.hpp&g

我有两个Yocto构建在不同的处理器上运行,我正在尝试用GStreamer编写一个OpenCV代码,其中一个将发送数据包,另一个将接收数据包。我面临的问题是,在接收器脚本中,程序被“VideoCapture”功能卡住,无法进一步执行。接收器与HDMI屏幕相连,在运行目标文件后,监视器上没有变化。下面我附上代码

#include <iostream>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>

using namespace std;
using namespace cv;

int main(void)
{
        cout<<"in main function"<<endl;
        const char* gstrec="udpsrc port=5000 ! application/x-rtp,media=video,encoding-name=H264,payload=96,clock-rate=90000,framerate=30/1 ! \
                            rtpjitterbuffer latency=10 drop-on-latency=TRUE ! rtph264depay ! video/x-h264 ! h264parse ! decodebin ! video/x-raw,\
                            format=NV12 ! videoconvert ! video/x-raw,format=BGR ! appsink";

        cout<<"Gstreamer script running"<<endl;
        VideoCapture cap(gstrec,CAP_GSTREAMER);
        cout<<"You are out of VideoCapture function"<<endl;

    if(!cap.isOpened())
    {
        cout<<"VideoCapture not opened"<<endl;
        exit(-1);
    }

    cout<<"The videocapture is opened"<<endl;

    Mat frame;

    for(;;) {

        cap.read(frame);
        if(frame.empty())
            break;

        cout<<"In while loop"<<endl;
        imshow("Receiver", frame);
        if(waitKey(1) == 'r')
            break;
    }
    destroyWindow("Receiver");

return 0;
}
#包括
#包括
#包括
使用名称空间std;
使用名称空间cv;
内部主(空)
{
库特