<span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><font class="Apple-style-span" face="arial, sans-serif">In your application rtph264depay and </font>mpegtsmux<font class="Apple-style-span" face="arial, sans-serif"> can not be linked automatically because </font>muxers<font class="Apple-style-span" face="arial, sans-serif"> have got &quot;request pads&quot;, for more information about &quot;request pads&quot;  and how you link them with normal pads,  have a look at following link;</font><br>
</span><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-pads.html" target="_blank" style="color: rgb(0, 0, 204); ">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-pads.html</a></span><div>
<br><br><div class="gmail_quote">On Mon, Aug 15, 2011 at 7:27 PM, android6011 <span dir="ltr">&lt;<a href="mailto:android6011@gmail.com">android6011@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello everyone, I am trying to replicate the following &quot;gst-launch rtspsrc location=rtsp://<a href="http://10.10.10.3:554" target="_blank">10.10.10.3:554</a> ! rtph264depay ! mpegtsmux ! filesink location=out.ts&quot;  .<div>
<br></div>
<div>This line works in producing video output but when the following code is used the output file is always 0 in size. Any pointers on why this might be happening would be appreciated<br><div><br></div><div><div>#include &lt;stdio.h&gt;</div>

<div>#include &lt;gst/gst.h&gt;</div><div><br></div><div>int main (int argc, char *argv[])</div><div>{</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;STARTING %d \n&quot;,1);</div><div>
<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Init</div><div><span style="white-space:pre-wrap">        </span>gst_init (&amp;argc, &amp;argv);</div>
<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Get Ready</div><div><span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">        </span>GstPipeline *pipeline = GST_PIPELINE(gst_pipeline_new(&quot;pipeline&quot;));</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Created Pipeline\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Prep Source</div><div><span style="white-space:pre-wrap">        </span>GstElement *source = gst_element_factory_make(&quot;rtspsrc&quot;,&quot;source&quot;);</div>

<div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(source),&quot;location&quot;,&quot;rtsp://<a href="http://10.10.10.3:554" target="_blank">10.10.10.3:554</a>&quot;,NULL);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Created SRC\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Prep Decode</div><div><span style="white-space:pre-wrap">        </span>GstElement *demux =gst_element_factory_make(&quot;rtph264depay&quot;,&quot;demux&quot;);</div>

<div><span style="white-space:pre-wrap">        </span>printf(&quot;Created Demux\n&quot;);</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Prep Encode</div>
<div><span style="white-space:pre-wrap">        </span>GstElement *mux = gst_element_factory_make(&quot;mpegtsmux&quot;,&quot;mux&quot;);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Created Mux\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//prep output</div><div><span style="white-space:pre-wrap">        </span>GstElement *dest = gst_element_factory_make(&quot;filesink&quot;,&quot;dest&quot;);</div>

<div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(dest),&quot;location&quot;,&quot;output.ts&quot;,NULL);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Created Output\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Link</div><div><span style="white-space:pre-wrap">        </span>gst_element_link_many(source,demux,mux,dest,NULL);</div>
<div><span style="white-space:pre-wrap">        </span>printf(&quot;Done Linking\n&quot;);</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>//Add</div>
<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>gst_bin_add_many(GST_BIN(pipeline),source,demux,mux,dest,NULL);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Added Elements To Pipe\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span></div><div>
<span style="white-space:pre-wrap">        </span>gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;CSet State\n&quot;);</div>
<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>GMainLoop *loop = g_main_loop_new(NULL,FALSE);</div><div><span style="white-space:pre-wrap">        </span>printf(&quot;Starting Loop...\n&quot;);</div>

<div><span style="white-space:pre-wrap">        </span>g_main_loop_run(loop);</div><div>  </div><div><br></div><div>  </div><div><span style="white-space:pre-wrap">        </span>printf(&quot;done\n&quot;);</div>
<div><span style="white-space:pre-wrap">        </span>return 0;</div><div>}</div></div><div><br></div></div>
<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br><br>Sudarshan Bisht<br>
</div>