<br />hi,<br />i think you should try with fluendo mpegts demuxer.<br />you can download it from fluendo site free of cost.<br /><br /><br />cheers!<br />digitaldsp<br /><br /><br /><br /> --- On Tue 09/25, sangita pithadia &lt; sangitapithadia@gmail.com &gt; wrote:<br /><blockquote style="border-left: 2px solid orange; padding-left: 7px; margin-left: 7px;"><b>From: </b>sangita pithadia [mailto: sangitapithadia@gmail.com]<br /><b>To: </b>gstreamer-devel@lists.sourceforge.net<br /><b>Date: </b>Tue, 25 Sep 2007 12:18:19 +0000<br /><b>Subject: </b>[gst-devel] gstreamer problem<br /><br />Hi,<br /><br />I m trying to play MPEG TS using gstreamer pipeline. <br />This is the pipeline which i have used to playback the file. It works fine.<br /><br /><br /><br /><br /><br /><br /><pre>gst-launch -v filesrc location=/root/GStremerDir/gstreamer-0.10.13/ed24p_00.ts ! ffdemux_mpegts ! ffdec_mpeg2video ! queue ! videoscale ! ffmpegcolorspace ! xvimagesink </pre><br />Same thing i tried to 
do using the code but it doesnt play.<br />my code is like..<br /><br /><br /><br /><br /><br /><br /><pre><span style="color: rgb(0, 128, 0);">#include<stdio.h /></span><br /><span style="color: rgb(0, 128, 0);">#define SOURCE &quot;filesrc&quot;</span><br /><span style="color: rgb(0, 128, 0);">#define VSINK &quot;xvimagesink&quot;</span><br /><span style="color: rgb(0, 128, 0);">#define ASINK &quot;alsasink&quot;</span><br /><span style="color: rgb(0, 128, 0);">#include <stdlib.h /></span><br /><span style="color: rgb(0, 128, 0);">#include <glib.h /></span><br /><span style="color: rgb(128, 128, 128);"><i>//#include <gtk /></i></span><br /><span style="color: rgb(0, 128, 0);">#include <gst /></span><br /><span style="color: rgb(0, 128, 0);">#include <string.h /></span><br /><br /><span style="color: rgb(128, 0, 0);">const</span> gchar * location = <span style="color: rgb(221, 0, 0);">&quot;file:///root/GStremerDir/ed24p_00.ts&quot;</span>;<br /><span style="color: rgb(128, 
0, 0);">static</span> GList *seekable_pads = NULL;<br /><span style="color: rgb(128, 0, 0);">static</span> GList *rate_pads = NULL;<br /><span style="color: rgb(128, 0, 0);">static</span> GstElement *pipeline;<br /><span style="color: rgb(128, 0, 0);">static</span> GList *seekable_elements = NULL;<br /><b>typedef</b> <b>struct</b><br />{<br />        <span style="color: rgb(128, 0, 0);">const</span> gchar *padname;<br />        GstPad *target;<br />        GstElement *bin;<br />}<br />dyn_link;<br /><br /><span style="color: rgb(128, 0, 0);">static</span> gboolean<br />bus_call (GstBus     *bus,<br />          GstMessage *msg,<br />          gpointer    data)<br />{<br />  GMainLoop *loop = (GMainLoop *) data;<br /><br />  <b>switch</b> (GST_MESSAGE_TYPE (msg)) {<br />    <b>case</b> GST_MESSAGE_EOS:<br />      g_print (<span style="color: rgb(221, 0, 0);">&quot;End-of-stream</span><span style="color: rgb(255, 0, 255);">\n</span><span style="color: rgb(221, 0, 0);">&quot;</span>);<br />      g_main_loop_quit 
(loop);<br />      <b>break</b>;<br />    <b>case</b> GST_MESSAGE_ERROR: {<br />      gchar *debug;<br />      GError *err;<br /><br />      gst_message_parse_error (msg, &amp;err, &amp;debug);<br />      g_free (debug);<br /><br />      g_print (<span style="color: rgb(221, 0, 0);">&quot;Error: %s</span><span style="color: rgb(255, 0, 255);">\n</span><span style="color: rgb(221, 0, 0);">&quot;</span>, err-&gt;message);<br />      g_error_free (err);<br /><br />      g_main_loop_quit (loop);<br />      <b>break</b>;<br />    }<br />    <b>default</b>:<br />      <b>break</b>;<br />  }<br />}<br /><br /><span style="color: rgb(128, 0, 0);">static</span> GstElement *<br />gst_element_factory_make_or_warn (gchar * type, gchar * name)<br />{<br />        GstElement *element = gst_element_factory_make (type, name);<br />        <br />        <b>if</b> (!element) {<br />        g_warning (<span style="color: rgb(221, 0, 0);">&quot;Failed to create element %s of type %s&quot;</span>, name, type);<br />        }<br />        
<br />        <b>return</b> element;<br />}<br /><span style="color: rgb(128, 0, 0);">static</span> <span style="color: rgb(128, 0, 0);">void</span> dynamic_link (GstPadTemplate * templ, GstPad * newpad, gpointer data)<br />{<br />        gchar *padname;<br />        dyn_link *connect = (dyn_link *) data;<br />        <br />        padname = gst_pad_get_name (newpad);<br />        <br />        <b>if</b> (connect-&gt;padname == NULL || !strcmp (padname, connect-&gt;padname)) {<br />        <b>if</b> (connect-&gt;bin)<br />        gst_bin_add (GST_BIN (pipeline), connect-&gt;bin);<br />        gst_pad_link (newpad, connect-&gt;target);<br />        <br />        seekable_pads = g_list_prepend (seekable_pads, newpad);<br />        rate_pads = g_list_prepend (rate_pads, newpad);<br />        }<br />        g_free (padname);<br />}<br /><br /><span style="color: rgb(128, 0, 0);">static</span> <span style="color: rgb(128, 0, 0);">void</span> setup_dynamic_link (GstElement * element, <span style="color: rgb(128, 0, 0);">const</span> gchar * padname,<br />    GstPad * target, 
GstElement * bin)<br />{<br />        dyn_link *connect;<br />        <br />        connect = g_new0 (dyn_link, <span style="color: rgb(0, 0, 255);">1</span>);<br />        connect-&gt;padname = g_strdup (padname);<br />        connect-&gt;target = target;<br />        connect-&gt;bin = bin;<br />        <br />        g_signal_connect (G_OBJECT (element), <span style="color: rgb(221, 0, 0);">&quot;pad-added&quot;</span>, G_CALLBACK (dynamic_link),<br />        connect);<br />}<br /><span style="color: rgb(128, 0, 0);">int</span> main(<span style="color: rgb(128, 0, 0);">int</span> argc,<span style="color: rgb(128, 0, 0);">char</span> *argv[])<br />{<br />        <span style="color: rgb(128, 0, 0);">static</span> GstElement *bin;        <br />        GstBus *bus;<br />        GMainLoop *loop;<br />        GstElement *pipeline, *audio_bin, *video_bin;<br />        GstElement *src, *demux, *a_decoder, *v_decoder, *v_filter;<br />        GstElement *audiosink, *videosink;<br />        GstElement *a_queue, *v_queue, *v_scale;<br />        GstPad *seekable;<br />        GstPad *pad;<br />        <br />        gst_init 
(&amp;argc, &amp;argv);<br />        loop = g_main_loop_new (NULL, FALSE);<br />        <b>if</b> (argc != <span style="color: rgb(0, 0, 255);">2</span>) <br />        {<br />                   g_print (<span style="color: rgb(221, 0, 0);">&quot;Usage: %s <avi /></span><span style="color: rgb(255, 0, 255);">\n</span><span style="color: rgb(221, 0, 0);">&quot;</span>, argv[<span style="color: rgb(0, 0, 255);"><br />0</span>]);<br />                   <b>return</b> -<span style="color: rgb(0, 0, 255);">1</span>;<br />          }<br /><br />        pipeline = gst_pipeline_new (<span style="color: rgb(221, 0, 0);">&quot;app&quot;</span>);<br />        <br />        src = gst_element_factory_make_or_warn (SOURCE, <span style="color: rgb(221, 0, 0);">&quot;src&quot;</span>);<br />        g_object_set (G_OBJECT (src), <span style="color: rgb(221, 0, 0);">&quot;location&quot;</span>, argv[<span style="color: rgb(0, 0, 255);">1</span>], NULL);<br />        <br />        <span style="color: rgb(128, 128, 128);"><i>//demux = gst_element_factory_make_or_warn (&quot;mpegdemux&quot;, 
&quot;demux&quot;);</i></span><br />        demux = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;ffdemux_mpegts&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;demux&quot;</span>);<br />        <br />        gst_bin_add (GST_BIN (pipeline), src);<br />        gst_bin_add (GST_BIN (pipeline), demux);<br />        gst_element_link (src, demux);<br />        <br />        audio_bin = gst_bin_new (<span style="color: rgb(221, 0, 0);">&quot;a_decoder_bin&quot;</span>);<br />        a_decoder = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;mad&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;a_dec&quot;</span>);<br />        a_queue = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;queue&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;a_queue&quot;</span>);<br />        audiosink = gst_element_factory_make_or_warn (ASINK, <span style="color: rgb(221, 0, 0);">&quot;a_sink&quot;</span>);<br />        gst_bin_add (GST_BIN (audio_bin), 
a_decoder);<br />        gst_bin_add (GST_BIN (audio_bin), a_queue);<br />        gst_bin_add (GST_BIN (audio_bin), audiosink);<br />        <br />        gst_element_link (a_decoder, a_queue);<br />        gst_element_link (a_queue, audiosink);<br />        <br />        gst_bin_add (GST_BIN (pipeline), audio_bin);<br />        <br />        pad = gst_element_get_pad (a_decoder, <span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>);<br />        gst_element_add_pad (audio_bin, gst_ghost_pad_new (<span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>, pad));<br />        gst_object_unref (pad);<br />        <br />        setup_dynamic_link (demux, <span style="color: rgb(221, 0, 0);">&quot;audio_c0&quot;</span>, gst_element_get_pad (audio_bin,<br />                <span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>), NULL);<br />        <br />        video_bin = gst_bin_new (<span style="color: rgb(221, 0, 0);">&quot;v_decoder_bin&quot;</span>);<br />        v_decoder = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;mpeg2dec&quot;</span>, <span 
style="color: rgb(221, 0, 0);">&quot;v_dec&quot;</span>);<br />        v_queue = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;queue&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;v_queue&quot;</span>);<br />        v_scale = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;videoscale&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;v_scale&quot;</span>);<br />        v_filter = gst_element_factory_make_or_warn (<span style="color: rgb(221, 0, 0);">&quot;ffmpegcolorspace&quot;</span>, <span style="color: rgb(221, 0, 0);">&quot;v_filter&quot;</span>);<br />        videosink = gst_element_factory_make_or_warn (VSINK, <span style="color: rgb(221, 0, 0);">&quot;v_sink&quot;</span>);<br />        <br />        gst_bin_add (GST_BIN (video_bin), v_decoder);<br />        gst_bin_add (GST_BIN (video_bin), v_queue);<br />        gst_bin_add (GST_BIN (video_bin), v_scale);<br />        gst_bin_add (GST_BIN (video_bin), v_filter);<br />        gst_bin_add (GST_BIN (video_bin), 
videosink);<br />        <br />        gst_element_link (v_decoder, v_queue);<br />        gst_element_link (v_queue, v_scale);<br />        gst_element_link (v_scale, v_filter);<br />        gst_element_link (v_filter, videosink);<br />        <br />        gst_bin_add (GST_BIN (pipeline), video_bin);<br />        <br />        pad = gst_element_get_pad (v_decoder, <span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>);<br />        gst_element_add_pad (video_bin, gst_ghost_pad_new (<span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>, pad));<br />        gst_object_unref (pad);<br />        <br />        setup_dynamic_link (demux, <span style="color: rgb(221, 0, 0);">&quot;video_e0&quot;</span>, gst_element_get_pad (video_bin,<br />                <span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>), NULL);<br />        <br />        /*seekable = gst_element_get_pad (v_filter, <span style="color: rgb(221, 0, 0);">&quot;src&quot;</span>);<br />        seekable_pads = g_list_prepend (seekable_pads, seekable);<br />        rate_pads = g_list_prepend (rate_pads, seekable);<br />        
rate_pads =<br />        g_list_prepend (rate_pads, gst_element_get_pad (v_decoder, <span style="color: rgb(221, 0, 0);">&quot;sink&quot;</span>));*/<br /><br />        bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br />          gst_bus_add_watch (bus, bus_call, loop);<br />           <br />        gst_element_set_state (pipeline, GST_STATE_PLAYING);<br />        <span style="color: rgb(128, 128, 128);"><i>/* now run */</i></span><br />        g_main_loop_run (loop);<br /><br />        gst_element_set_state (pipeline, GST_STATE_NULL);<br />          gst_object_unref (GST_OBJECT (pipeline));<br />        gst_object_unref (bus);<br />          exit (<span style="color: rgb(0, 0, 255);">0</span>);<br />}<br /><br /><span style="color: rgb(0, 128, 0);"></span></pre>Can anyone tell me what can be the cause of this.<br /><br />Thanks in advance.<br /><p>-------------------------------------------------------------------------<br />This SF.net email is sponsored by: Microsoft<br />Defy all challenges. Microsoft(R) Visual Studio 2005.<br 
/>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________<br />gstreamer-devel mailing list<br />gstreamer-devel@lists.sourceforge.net<br />https://lists.sourceforge.net/lists/listinfo/gstreamer-devel<br /></p></blockquote><p><hr><font size=2 face=geneva><b>Join Excite! - <a href=http://www.excite.com target=_blank>http://www.excite.com</a></b><br>The most personalized portal on the Web!</font>