使用RTSP协议传输MJPEG视频时出错

时间:2017-11-06 13:49:22

标签: c++ opencv gstreamer

我想用OpenCV和Gstreamer从我的以太网相机中流式传输MJPEG视频。 我试图使用以下gstreamer管道打开流:

std::string pipe( 
                "rtspsrc location=rtsp://192.168.1.219:554/video.pro1 ! application/x-rtp,encoding-name=JPEG,payload=26 ! " 
                "rtpjpegdepay ! jpegdec ! xvimagesink sync=false ! appsink" 
        ); 
cv::VideoCapture cap(pipe, cv::CAP_GSTREAMER);

但是之前的代码返回了以下错误:

OpenCV Error: Unspecified error (GStreamer: cannot find appsink in manual pipeline 
) in cvCaptureFromCAM_GStreamer, file /home/nvidia/Documents/CameraTests/src/opencv-3.3.0/modules/videoio/src/cap_gstreamer.cpp, line 796 
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception: 

/home/nvidia/Documents/CameraTests/src/opencv-3.3.0/modules/videoio/src/cap_gstreamer.cpp:796: error: (-2) GStreamer: cannot find appsink in manual pipeline 
 in function cvCaptureFromCAM_GStreamer 

我设法使用H264和H265算法流式传输相同的RTSP源, MJPEG是唯一不起作用的格式,那么我认为这是一个gstreamer管道问题..

感谢

0 个答案:

没有答案