# Gstreamer rtpbin with VideoWriter?

**URL:** https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735
**Category:** C++
**Tags:** gstreamer, videoio
**Created:** [June 7, 2021, 6:09pm UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735 "2021-06-07T18:09:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![henris42](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@henris42](https://forum.opencv.org/u/henris42)
#### Post date: [June 7, 2021, 6:09pm UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/1 "2021-06-07T18:09:25Z")

</div>

Hi,

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:

```auto
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=10.1.1.12 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.

//HS

---

<div class="post-metadata">

### Author: ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)
#### Post date: [June 8, 2021, 7:02am UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/2 "2021-06-08T07:02:32Z")

</div>

> [@henris42](#):
>
> but I just get syntax error with C++.

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

---

<div class="post-metadata">

### Author: ![henris42](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@henris42](https://forum.opencv.org/u/henris42)
#### Post date: [June 8, 2021, 7:39am UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/3 "2021-06-08T07:39:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [June 8, 2021, 8:33am UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/4 "2021-06-08T08:33:41Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![henris42](https://avatars.discourse-cdn.com/v4/letter/h/ebca7d/32.png) [@henris42](https://forum.opencv.org/u/henris42)
#### Post date: [June 9, 2021, 6:37am UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/5 "2021-06-09T06:37:34Z")

</div>

Here is the error:

```auto
(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

```

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [June 9, 2021, 10:37am UTC](https://forum.opencv.org/t/gstreamer-rtpbin-with-videowriter/3735/6 "2021-06-09T10:37:02Z")

</div>

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.
