<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 "request pads", for more information about "request pads" 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"><<a href="mailto:android6011@gmail.com">android6011@gmail.com</a>></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 "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" .<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 <stdio.h></div>
<div>#include <gst/gst.h></div><div><br></div><div>int main (int argc, char *argv[])</div><div>{</div><div><span style="white-space:pre-wrap">        </span>printf("STARTING %d \n",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 (&argc, &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("pipeline"));</div><div><span style="white-space:pre-wrap">        </span>printf("Created Pipeline\n");</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("rtspsrc","source");</div>
<div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(source),"location","rtsp://<a href="http://10.10.10.3:554" target="_blank">10.10.10.3:554</a>",NULL);</div><div><span style="white-space:pre-wrap">        </span>printf("Created SRC\n");</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("rtph264depay","demux");</div>
<div><span style="white-space:pre-wrap">        </span>printf("Created Demux\n");</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("mpegtsmux","mux");</div><div><span style="white-space:pre-wrap">        </span>printf("Created Mux\n");</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("filesink","dest");</div>
<div><span style="white-space:pre-wrap">        </span>g_object_set(G_OBJECT(dest),"location","output.ts",NULL);</div><div><span style="white-space:pre-wrap">        </span>printf("Created Output\n");</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("Done Linking\n");</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("Added Elements To Pipe\n");</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("CSet State\n");</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("Starting Loop...\n");</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("done\n");</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>