<div>Thanks a ton <font color="#888888">Nathanael.</font></div>
<div><font color="#888888">It worked for me.</font></div>
<div><br><br> </div>
<div class="gmail_quote">On Fri, Mar 11, 2011 at 12:25 PM, Nathanael D. Noblet <span dir="ltr">&lt;<a href="mailto:nathanael@gnat.ca">nathanael@gnat.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div></div>
<div class="h5">On 03/10/2011 11:15 PM, Ashwini Sharma wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi All,<br><br>I am trying to play a mp4 file. When I play from command line using the<br>pipe:<br>&quot;gst-launch filesrc location=/home/ashwini/streams/output.ts !<br>
mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink&quot;<br><br>The video is displayed well.<br> But when i try to achieve the same pipe thru the application, It fails.<br><br>The code snippet of pipelie creation is as follows:<br>
<br>pipeline = gst_pipeline_new (&quot;gst-player&quot;);<br>//gst_debug_set_default_threshold(GST_LEVEL_DEBUG);<br>gst_debug_set_threshold_for_name(&quot;mpegtsparse&quot;,GST_LEVEL_DEBUG);<br>    src = gst_element_factory_make (&quot;filesrc&quot;, NULL);<br>
    g_assert (src);<br>g_print(&quot;URI = %s\n&quot;,uri);<br>    g_object_set (G_OBJECT (src), &quot;location&quot;, uri, NULL);<br>    parse = gst_element_factory_make (&quot;mpegtsparse&quot;, NULL);<br>    g_assert (parse);<br>
    demux = gst_element_factory_make (&quot;mpegtsdemux&quot;, NULL);<br>    g_assert (demux);<br>    dec = gst_element_factory_make (&quot;decodebin&quot;, NULL);<br>    g_assert (dec);<br>    csp = gst_element_factory_make (&quot;ffmpegcolorspace&quot;, NULL);<br>
    g_assert (csp);<br>    videosink = gst_element_factory_make (&quot;ximagesink&quot;, NULL);<br>    g_assert (videosink);<br><br>    /* Adding elements to the pipeline */<br>    gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp,<br>
videosink, NULL);<br>    //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);<br>   // g_assert (gst_element_link_many (src, parse, demux, dec, csp,<br>videosink, NULL));<br>    g_assert (gst_element_link (src, parse));<br>
    g_assert (gst_element_link (parse, demux));<br>    gst_element_link (demux, dec);<br>    (gst_element_link (dec, csp));<br>    (gst_element_link (csp, videosink));<br>    if (GST_IS_X_OVERLAY (videosink))<br>    {<br>
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink),<br>GPOINTER_TO_INT (window));<br>    }<br><br>    gst_element_set_state (pipeline, GST_STATE_PLAYING);<br><br>What could be causing it to fail. (In the above snippet described, I<br>
have used the gst-player code and modified the pipe to current state)<br><br>Any help is appreciated.<br></blockquote><br></div></div>You need to listen for &#39;pad-added&#39; signal from the decoder and check the gst_element_link() calls for success.<br>
<br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html</a><br>
<font color="#888888"><br>-- <br>Nathanael d. Noblet<br>t 403.875.4613<br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">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></font></blockquote></div><br>