2017-06-04 105 views
0

的Mac:使用OpenCV的从的Gstreamer收到

cv::VideoCapture cap("tcpclientsrc host=129.31.224.100 port=8888 ! gdpdepay ! rtph264depay ! avdec_h264 ! " 
           "videoconvert ! appsink"); 
    if (!cap.isOpened()) { 
     printf("=ERR= can't create video capture\n"); 
     return -1; 
    } 

RPI:

gst-launch-1.0 wrappercamerabinsrc ! video/x-raw, 
framerate=30/1, width=1280, height=720, format=RGB ! 
videoconvert ! vtenc_h264 ! h264parse ! 
rtph264pay config-interval=1 pt=96 ! gdppay ! 
tcpserversink host=129.31.224.100 port=8888 

的错误信息是:

VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception! 

=ERR= can't create video capture 

我想实现的东西是从阅读框架gstreamer通过使用OpenCV。

上述命令在命令行中工作,但不能在C++代码中工作。

预先感谢您!

回答

0

cap.open (const String &filename, int apiPreference)here可能是你在找什么。

您需要CAP_GSTREAMER(来自this list)。

我会张贴这个评论,但我没有声望。