<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);">This is the code I wrote to transmit video via rtp, that is not working.</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);">Do you see something wrong? How could I debug such kind of issues?</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);">Thanks in advance</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);">Elio</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: rgb(0, 0, 0);">    </span>/* the pipeline to hold everything */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span><span style="color: #4f8187">pPipeline</span><span style="color: #000000"> = </span>gst_pipeline_new<span style="color: #000000"> (</span><span style="color: #bb2ca2">NULL</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);"><span style="color: #000000">    </span><span style="color: #78492a">g_assert</span><span style="color: #000000"> (</span>pPipeline<span style="color: #000000">);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* the audio capture and format conversion */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    source = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"videotestsrc"</span><span style="color: #000000">,</span><span style="color: #d12f1b">"videosrc"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (source);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">    converter = </span><span style="color: #3d1d81">gst_element_factory_make</span><span style="color: #000000"> ( </span>"videoconvert"<span style="color: #000000">,  </span>"videoconv"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (converter);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* the encoding and payloading */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    encoder = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"vp8enc"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"videoenc"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (encoder);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    pay = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"rtpvp8pay"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"videopay"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (pay);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span>(pay, <span style="color: #d12f1b">"pt"</span>, <span style="color: #272ad8">103</span>, <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span><span style="color: #703daa">GstElement</span><span style="color: #000000"> *filter = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"capsfilter"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"filter"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #703daa">GstCaps</span>    *filtercaps = <span style="color: #3d1d81">gst_caps_new_simple</span> (<span style="color: #d12f1b">"video/x-raw"</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">                                                      <span style="color: #d12f1b">"format"</span>, <span style="color: #78492a">G_TYPE_STRING</span>, <span style="color: #d12f1b">"I420"</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">                                                      <span style="color: #d12f1b">"width"</span>, <span style="color: #78492a">G_TYPE_INT</span>, <span style="color: #272ad8">320</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">                                                      <span style="color: #d12f1b">"height"</span>, <span style="color: #78492a">G_TYPE_INT</span>, <span style="color: #272ad8">240</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">                                                      <span style="color: #bb2ca2">NULL</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span> (<span style="color: #78492a">G_OBJECT</span> (filter), <span style="color: #d12f1b">"caps"</span>, filtercaps, <span style="color: #bb2ca2">NULL</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">gst_caps_unref</span> (filtercaps);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* add capture and payloading to the pipeline and link */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">gst_bin_add_many</span> (<span style="color: #78492a">GST_BIN</span> (<span style="color: #4f8187">pPipeline</span>), source, filter, converter, encoder, pay, <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">if</span> (!<span style="color: #3d1d81">gst_element_link_many</span> (source, filter, converter, encoder, pay, <span style="color: #bb2ca2">NULL</span>))</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">            </span><span style="color: #78492a">g_error</span><span style="color: #000000"> (</span>"Failed to link source, videorate, converter, encoder, pay"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">            <span style="color: #bb2ca2">return</span> <span style="color: #bb2ca2">false</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    }</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* the rtpbin element */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    rtpbin = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"rtpbin"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"rtpbin"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (rtpbin);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">gst_bin_add</span> (<span style="color: #78492a">GST_BIN</span> (<span style="color: #4f8187">pPipeline</span>), rtpbin);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* the udp sinks and source we will use for RTP and RTCP */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    rtpsink = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"udpsink"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"rtpsink"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (rtpsink);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span> (rtpsink, <span style="color: #d12f1b">"port"</span>, remoteAddr.<span style="color: #31595d">getRtpPort</span>(), <span style="color: #d12f1b">"host"</span>, remoteAddr.<span style="color: #31595d">getAddress</span>().<span style="color: #3d1d81">c_str</span>(), <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    rtcpsink = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"udpsink"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"rtcpsink"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (rtcpsink);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span> (rtcpsink, <span style="color: #d12f1b">"port"</span>, remoteAddr.<span style="color: #31595d">getRtcpPort</span>(), <span style="color: #d12f1b">"host"</span>, remoteAddr.<span style="color: #31595d">getAddress</span>().<span style="color: #3d1d81">c_str</span>(), <span style="color: #bb2ca2">NULL</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* no need for synchronisation or preroll on the RTCP sink */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span> (rtcpsink, <span style="color: #d12f1b">"async"</span>, <span style="color: #bb2ca2">FALSE</span>, <span style="color: #d12f1b">"sync"</span>, <span style="color: #bb2ca2">FALSE</span>, <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    rtcpsrc = </span>gst_element_factory_make<span style="color: #000000"> (</span><span style="color: #d12f1b">"udpsrc"</span><span style="color: #000000">, </span><span style="color: #d12f1b">"rtcpsrc"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #78492a">g_assert</span> (rtcpsrc);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">g_object_set</span> (rtcpsrc, <span style="color: #d12f1b">"port"</span>, localAddr.<span style="color: #31595d">getRtcpPort</span>(), <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #3d1d81">gst_bin_add_many</span> (<span style="color: #78492a">GST_BIN</span> (<span style="color: #4f8187">pPipeline</span>), rtpsink, rtcpsink, rtcpsrc, <span style="color: #bb2ca2">NULL</span>);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* now link all to the rtpbin, start by getting an RTP sinkpad for session 0 */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    sinkpad = </span>gst_element_get_request_pad<span style="color: #000000"> (rtpbin, </span><span style="color: #d12f1b">"send_rtp_sink_0"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    srcpad = </span>gst_element_get_static_pad<span style="color: #000000"> (pay, </span><span style="color: #d12f1b">"src"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">if</span> (<span style="color: #3d1d81">gst_pad_link</span> (srcpad, sinkpad) != <span style="color: #3d1d81">GST_PAD_LINK_OK</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">        </span><span style="color: #78492a">g_error</span><span style="color: #000000"> (</span>"Failed to link audio payloader to rtpbin"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span>gst_object_unref<span style="color: #000000"> (srcpad);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* get the RTP srcpad that was created when we requested the sinkpad above and</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">     * link it to the rtpsink sinkpad*/</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    srcpad = </span>gst_element_get_static_pad<span style="color: #000000"> (rtpbin, </span><span style="color: #d12f1b">"send_rtp_src_0"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    sinkpad = <span style="color: #3d1d81">gst_element_get_static_pad</span> (rtpsink, <span style="color: #d12f1b">"sink"</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">if</span> (<span style="color: #3d1d81">gst_pad_link</span> (srcpad, sinkpad) != <span style="color: #3d1d81">GST_PAD_LINK_OK</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">        </span><span style="color: #78492a">g_error</span><span style="color: #000000"> (</span>"Failed to link rtpbin to rtpsink"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span>gst_object_unref<span style="color: #000000"> (srcpad);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span>gst_object_unref<span style="color: #000000"> (sinkpad);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* get an RTCP srcpad for sending RTCP to the receiver */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    srcpad = </span>gst_element_get_request_pad<span style="color: #000000"> (rtpbin, </span><span style="color: #d12f1b">"send_rtcp_src_0"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    sinkpad = <span style="color: #3d1d81">gst_element_get_static_pad</span> (rtcpsink, <span style="color: #d12f1b">"sink"</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">if</span> (<span style="color: #3d1d81">gst_pad_link</span> (srcpad, sinkpad) != <span style="color: #3d1d81">GST_PAD_LINK_OK</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">        </span><span style="color: #78492a">g_error</span><span style="color: #000000"> (</span>"Failed to link rtpbin to rtcpsink"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span>gst_object_unref<span style="color: #000000"> (sinkpad);</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span style="color: #000000">    </span>/* we also want to receive RTCP, request an RTCP sinkpad for session 0 and</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">     * link it to the srcpad of the udpsrc for RTCP */</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    srcpad = <span style="color: #3d1d81">gst_element_get_static_pad</span> (rtcpsrc, <span style="color: #d12f1b">"src"</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    sinkpad = </span>gst_element_get_request_pad<span style="color: #000000"> (rtpbin, </span><span style="color: #d12f1b">"recv_rtcp_sink_0"</span><span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span style="color: #bb2ca2">if</span> (<span style="color: #3d1d81">gst_pad_link</span> (srcpad, sinkpad) != <span style="color: #3d1d81">GST_PAD_LINK_OK</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">        </span><span style="color: #78492a">g_error</span><span style="color: #000000"> (</span>"Failed to link rtcpsrc to rtpbin"<span style="color: #000000">);</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(61, 29, 129);"><span style="color: #000000">    </span>gst_object_unref<span style="color: #000000"> (srcpad);</span></div></div><div><br></div><br><div><div>On 30 Oct 2013, at 22:21, Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Mi, 2013-10-30 at 22:17 +0100, Elio Francesconi wrote:<br><blockquote type="cite">Hi all,<br>I’m creating a pipeline to send rtp video stream but I cannot find any option to change he payload type.<br><br> gst-launch-0.10 -v videotestsrc ! vp8enc ! rtpvp8pay ! udpsink host=127.0.0.1 port=5011<br></blockquote><br>The "pt" property on the payloaders can be used for that.<br><br>You should also consider updating to GStreamer 1.x if possible as 0.10<br>is no longer maintained since almost two years.<br><br>-- <br>Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>><br>Centricular Ltd - <a href="http://www.centricular.com">http://www.centricular.com</a><br>Expertise, Straight from the Source<br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br></blockquote></div><br></body></html>