<div>Hi  </div>
<div> </div>
<div>   You can not link demuxer and decoder using gst_element_link_many(src, dmx, dec, sink, NULL) function . You need to link these two elements in callback function  because demuxer has to create these pads dynamically. <br>
<br></div>
<div class="gmail_quote">On Mon, Jul 20, 2009 at 10:00 AM, E. Westbrook <span dir="ltr">&lt;<a href="mailto:gstreamer@westbrook.com">gstreamer@westbrook.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Can someone please help me spot how I&#39;m being stupid?<br><br>I can play a FLV file using:<br><br>
<div style="MARGIN-LEFT: 40px"><font size="1"><span style="FONT-FAMILY: courier new,monospace">$ gst-launch filesrc location=jerrydog.flv ! ffdemux_flv ! ffdec_flv ! xvimagesink</span></font><br></div><br>But when I try to play the same file with the following code, it hangs with no output.<br>
<br>
<div style="MARGIN-LEFT: 40px"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;unistd.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;stdio.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;stdlib.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;gst/gst.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">int main(int argc, char** argv) {</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_init(&amp;argc, &amp;argv);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GMainLoop* loop = g_main_loop_new(NULL, FALSE);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstPipeline* p = GST_PIPELINE(gst_pipeline_new(&quot;pipey&quot;));</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* src = gst_element_factory_make(&quot;filesrc&quot;, &quot;filey&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* dmx = gst_element_factory_make(&quot;ffdemux_flv&quot;, &quot;demuxey&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* dec = gst_element_factory_make(&quot;ffdec_flv&quot;, &quot;decodey&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* sink = gst_element_factory_make(&quot;xvimagesink&quot;, &quot;sinky&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  g_object_set(G_OBJECT(src), &quot;location&quot;, &quot;jerrydog.flv&quot;, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_bin_add_many(GST_BIN(p), src, dmx, dec, sink, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_element_link_many(src, dmx, dec, sink, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_element_set_state(GST_ELEMENT(p), GST_STATE_PLAYING);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  g_main_loop_run(loop);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  return 0;</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">}</span></font><br style="FONT-FAMILY: courier new,monospace">
</div><br>The thing is, I&#39;ve separately encoded the file to mpeg2, and I can also play it using:<br><br>
<div style="MARGIN-LEFT: 40px"><font size="1"><span style="FONT-FAMILY: courier new,monospace">$ gst-launch filesrc location=jerrydog.mp2 ! mpeg2dec ! xvimagesink</span></font><br></div><br>and then, puzzlingly, unlike the FLV version, my C code plays the mpeg2 flavor just great:<br>
<br>
<div style="MARGIN-LEFT: 40px"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;unistd.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;stdio.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;stdlib.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">#include &lt;gst/gst.h&gt;</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">int main(int argc, char** argv) {</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_init(&amp;argc, &amp;argv);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GMainLoop* loop = g_main_loop_new(NULL, FALSE);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstPipeline* p = GST_PIPELINE(gst_pipeline_new(&quot;pipey&quot;));</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* src = gst_element_factory_make(&quot;filesrc&quot;, &quot;filey&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* dec = gst_element_factory_make(&quot;mpeg2dec&quot;, &quot;decodey&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  GstElement* sink = gst_element_factory_make(&quot;xvimagesink&quot;, &quot;sinky&quot;);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  g_object_set(G_OBJECT(src), &quot;location&quot;, &quot;jerrydog.mp2&quot;, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_bin_add_many(GST_BIN(p), src, dec, sink, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_element_link_many(src, dec, sink, NULL);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  gst_element_set_state(GST_ELEMENT(p), GST_STATE_PLAYING);</span></font><br style="FONT-FAMILY: courier new,monospace">
<br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">  g_main_loop_run(loop);</span></font><br style="FONT-FAMILY: courier new,monospace"><br style="FONT-FAMILY: courier new,monospace">
<font size="1"><span style="FONT-FAMILY: courier new,monospace">  return 0;</span></font><br style="FONT-FAMILY: courier new,monospace"><font size="1"><span style="FONT-FAMILY: courier new,monospace">}</span></font><br></div>
<br>So what&#39;s confusing me is, in the FLV case, how am I constructing the pipeline wrongly in C, in the FLV case anyway, that differs from gst-launch?  Or am I?  Is this as dumb a question as it seems to me it must be?<br>
<br>Thanks,<br>E. Westbrook<br><br>PS - All test case source is here exactly as I&#39;m compiling it.  My input video files are available at:<br><br><a href="http://media.westbrook.com/media/jerrydog.flv" target="_blank">http://media.westbrook.com/media/jerrydog.flv</a><br>
<a href="http://media.westbrook.com/media/jerrydog.mp2" target="_blank">http://media.westbrook.com/media/jerrydog.mp2</a><br><br><br>------------------------------------------------------------------------------<br>Enter the BlackBerry Developer Challenge<br>
This is your chance to win up to $100,000 in prizes! For a limited time,<br>vendors submitting new applications to BlackBerry App World(TM) will have<br>the opportunity to enter the BlackBerry Developer Challenge. See full prize<br>
details at: <a href="http://p.sf.net/sfu/Challenge" target="_blank">http://p.sf.net/sfu/Challenge</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br><br></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Regards,<br><br>Sudarshan Bisht<br>