Gstreamer rtpbin with VideoWriter?


I’ve been trying to integrate OpenCV to Kurento, using RTP and RTCP with Gstreamer pipeline.

I got the pure RTP working with C++, but no success on how to write a pipeline that works with VideoWriter. Using gst-launch-1.0 works fine, but I just get syntax error with C++.

I’ve been trying this:

std::string Stream_Pipeline("rtpbin name=rtpbin appsrc is-live=true ! autovideoconvert ! "
        "omxh264enc control-rate=2 bitrate=90000 ! video/x-h264, stream-format=byte-stream ! rtph264pay mtu=1400 config-interval=1 pt=96 ! \"application/x-rtp,payload=(int)103,clock-rate=(int)90000,ssrc=(uint)112233\" ! rtpbin.send_rtp_sink_0 "
                   "rtpbin.send_rtp_src_0 ! udpsink host= port=44058 sync=false async=false bind-port=5004 "
                   "rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false "
                   "udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0");

 cv::VideoWriter Stream(Stream_Pipeline, cv::CAP_GSTREAMER, 30, cv::Size(1920, 1080), true);

Any ideas how to get it running? I’ve been unsuccessful finding working code using the rtpbin module.


so, where is it ? (ofc. you have to show us …)

How? Gstreamer does not open it at all. - its not C++ error, its the gstreamer syntax in that string. I have no idea how to see where is the issue.

you said “syntax error”, so please show us the complete “syntax error” message.

if you meant something else, say that.

you say there is an issue. how do you know there is an issue?

Here is the error:

(test:21289): GStreamer-CRITICAL **: 09:35:54.190: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

(test:21289): GStreamer-CRITICAL **: 09:35:54.191: gst_element_link_pads_filtered: assertion 'GST_IS_BIN (parent)' failed
[ WARN:0] global /home/hs/workspace/opencv-4.5.0/modules/videoio/src/cap_gstreamer.cpp (1424) open OpenCV | GStreamer warning: error opening writer pipeline: syntax error

ooookay this goes deep into gstreamer. I doubt very much that this is an issue in OpenCV.

you should find a forum or other place where gstreamer is the main topic. you need specialists for gstreamer.