pipeline failure when going from cmdline to app.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

pipeline failure when going from cmdline to app.

ak.ashwini
Hi All,
 
I am trying to play a mp4 file. When I play from command line using the pipe:
"gst-launch filesrc location=/home/ashwini/streams/output.ts ! mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink"

The video is displayed well.
 But when i try to achieve the same pipe thru the application, It fails.

The code snippet of pipelie creation is as follows:

pipeline = gst_pipeline_new ("gst-player");
//gst_debug_set_default_threshold(GST_LEVEL_DEBUG);
gst_debug_set_threshold_for_name("mpegtsparse",GST_LEVEL_DEBUG);
    src = gst_element_factory_make ("filesrc", NULL);
    g_assert (src);
g_print("URI = %s\n",uri);
    g_object_set (G_OBJECT (src), "location", uri, NULL);
    parse = gst_element_factory_make ("mpegtsparse", NULL);
    g_assert (parse);
    demux = gst_element_factory_make ("mpegtsdemux", NULL);
    g_assert (demux);
    dec = gst_element_factory_make ("decodebin", NULL);
    g_assert (dec);
    csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
    g_assert (csp);
    videosink = gst_element_factory_make ("ximagesink", NULL);
    g_assert (videosink);

    /* Adding elements to the pipeline */
    gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp, videosink, NULL);
    //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);
   // g_assert (gst_element_link_many (src, parse, demux, dec, csp, videosink, NULL));
    g_assert (gst_element_link (src, parse));
    g_assert (gst_element_link (parse, demux));
    gst_element_link (demux, dec);
    (gst_element_link (dec, csp));
    (gst_element_link (csp, videosink));
    if (GST_IS_X_OVERLAY (videosink))
    {
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GPOINTER_TO_INT (window));
    }

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

What could be causing it to fail. (In the above snippet described, I have used the gst-player code and modified the pipe to current state)

Any help is appreciated.

-Ashwini
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: pipeline failure when going from cmdline to app.

Nathanael D. Noblet
On 03/10/2011 11:15 PM, Ashwini Sharma wrote:

> Hi All,
>
> I am trying to play a mp4 file. When I play from command line using the
> pipe:
> "gst-launch filesrc location=/home/ashwini/streams/output.ts !
> mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink"
>
> The video is displayed well.
>   But when i try to achieve the same pipe thru the application, It fails.
>
> The code snippet of pipelie creation is as follows:
>
> pipeline = gst_pipeline_new ("gst-player");
> //gst_debug_set_default_threshold(GST_LEVEL_DEBUG);
> gst_debug_set_threshold_for_name("mpegtsparse",GST_LEVEL_DEBUG);
>      src = gst_element_factory_make ("filesrc", NULL);
>      g_assert (src);
> g_print("URI = %s\n",uri);
>      g_object_set (G_OBJECT (src), "location", uri, NULL);
>      parse = gst_element_factory_make ("mpegtsparse", NULL);
>      g_assert (parse);
>      demux = gst_element_factory_make ("mpegtsdemux", NULL);
>      g_assert (demux);
>      dec = gst_element_factory_make ("decodebin", NULL);
>      g_assert (dec);
>      csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
>      g_assert (csp);
>      videosink = gst_element_factory_make ("ximagesink", NULL);
>      g_assert (videosink);
>
>      /* Adding elements to the pipeline */
>      gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp,
> videosink, NULL);
>      //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);
>     // g_assert (gst_element_link_many (src, parse, demux, dec, csp,
> videosink, NULL));
>      g_assert (gst_element_link (src, parse));
>      g_assert (gst_element_link (parse, demux));
>      gst_element_link (demux, dec);
>      (gst_element_link (dec, csp));
>      (gst_element_link (csp, videosink));
>      if (GST_IS_X_OVERLAY (videosink))
>      {
>          gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink),
> GPOINTER_TO_INT (window));
>      }
>
>      gst_element_set_state (pipeline, GST_STATE_PLAYING);
>
> What could be causing it to fail. (In the above snippet described, I
> have used the gst-player code and modified the pipe to current state)
>
> Any help is appreciated.

You need to listen for 'pad-added' signal from the decoder and check the
gst_element_link() calls for success.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html

--
Nathanael d. Noblet
t 403.875.4613
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: pipeline failure when going from cmdline to app.

ak.ashwini
Thanks a ton Nathanael.
It worked for me.


 
On Fri, Mar 11, 2011 at 12:25 PM, Nathanael D. Noblet <[hidden email]> wrote:
On 03/10/2011 11:15 PM, Ashwini Sharma wrote:
Hi All,

I am trying to play a mp4 file. When I play from command line using the
pipe:
"gst-launch filesrc location=/home/ashwini/streams/output.ts !
mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink"

The video is displayed well.
 But when i try to achieve the same pipe thru the application, It fails.

The code snippet of pipelie creation is as follows:

pipeline = gst_pipeline_new ("gst-player");
//gst_debug_set_default_threshold(GST_LEVEL_DEBUG);
gst_debug_set_threshold_for_name("mpegtsparse",GST_LEVEL_DEBUG);
    src = gst_element_factory_make ("filesrc", NULL);
    g_assert (src);
g_print("URI = %s\n",uri);
    g_object_set (G_OBJECT (src), "location", uri, NULL);
    parse = gst_element_factory_make ("mpegtsparse", NULL);
    g_assert (parse);
    demux = gst_element_factory_make ("mpegtsdemux", NULL);
    g_assert (demux);
    dec = gst_element_factory_make ("decodebin", NULL);
    g_assert (dec);
    csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
    g_assert (csp);
    videosink = gst_element_factory_make ("ximagesink", NULL);
    g_assert (videosink);

    /* Adding elements to the pipeline */
    gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp,
videosink, NULL);
    //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);
   // g_assert (gst_element_link_many (src, parse, demux, dec, csp,
videosink, NULL));
    g_assert (gst_element_link (src, parse));
    g_assert (gst_element_link (parse, demux));
    gst_element_link (demux, dec);
    (gst_element_link (dec, csp));
    (gst_element_link (csp, videosink));
    if (GST_IS_X_OVERLAY (videosink))
    {
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink),
GPOINTER_TO_INT (window));
    }

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

What could be causing it to fail. (In the above snippet described, I
have used the gst-player code and modified the pipe to current state)

Any help is appreciated.

You need to listen for 'pad-added' signal from the decoder and check the gst_element_link() calls for success.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html

--
Nathanael d. Noblet
t 403.875.4613
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: pipeline failure when going from cmdline to app.

ak.ashwini
Now i need to capture the Section data of TS stream. I know this is posted by mpegtsparse element onto the bus.
 
But what i dont know is that, what is message type and how do i capture this data...?

 

Any clue...
 
-Ashwini


On Fri, Mar 11, 2011 at 12:53 PM, Ashwini Sharma <[hidden email]> wrote:
Thanks a ton Nathanael.
It worked for me.


 
On Fri, Mar 11, 2011 at 12:25 PM, Nathanael D. Noblet <[hidden email]> wrote:
On 03/10/2011 11:15 PM, Ashwini Sharma wrote:
Hi All,

I am trying to play a mp4 file. When I play from command line using the
pipe:
"gst-launch filesrc location=/home/ashwini/streams/output.ts !
mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink"

The video is displayed well.
 But when i try to achieve the same pipe thru the application, It fails.

The code snippet of pipelie creation is as follows:

pipeline = gst_pipeline_new ("gst-player");
//gst_debug_set_default_threshold(GST_LEVEL_DEBUG);
gst_debug_set_threshold_for_name("mpegtsparse",GST_LEVEL_DEBUG);
    src = gst_element_factory_make ("filesrc", NULL);
    g_assert (src);
g_print("URI = %s\n",uri);
    g_object_set (G_OBJECT (src), "location", uri, NULL);
    parse = gst_element_factory_make ("mpegtsparse", NULL);
    g_assert (parse);
    demux = gst_element_factory_make ("mpegtsdemux", NULL);
    g_assert (demux);
    dec = gst_element_factory_make ("decodebin", NULL);
    g_assert (dec);
    csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
    g_assert (csp);
    videosink = gst_element_factory_make ("ximagesink", NULL);
    g_assert (videosink);

    /* Adding elements to the pipeline */
    gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp,
videosink, NULL);
    //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);
   // g_assert (gst_element_link_many (src, parse, demux, dec, csp,
videosink, NULL));
    g_assert (gst_element_link (src, parse));
    g_assert (gst_element_link (parse, demux));
    gst_element_link (demux, dec);
    (gst_element_link (dec, csp));
    (gst_element_link (csp, videosink));
    if (GST_IS_X_OVERLAY (videosink))
    {
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink),
GPOINTER_TO_INT (window));
    }

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

What could be causing it to fail. (In the above snippet described, I
have used the gst-player code and modified the pipe to current state)

Any help is appreciated.

You need to listen for 'pad-added' signal from the decoder and check the gst_element_link() calls for success.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html

--
Nathanael d. Noblet
t 403.875.4613
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: pipeline failure when going from cmdline to app.

BGraaf

Hi Ashwini,

 

do you got any information about your question? I’m working also on a solution for ‘getting EIT messages out of the mpegtsparser’.

 

BR

Bernhard

 


Von: gstreamer-devel-bounces+bernhard.graaf=[hidden email] [mailto:gstreamer-devel-bounces+bernhard.graaf=[hidden email]] Im Auftrag von Ashwini Sharma
Gesendet: Freitag, 11. März 2011 08:26
An: Discussion of the development of and with GStreamer
Betreff: Re: pipeline failure when going from cmdline to app.

 

Now i need to capture the Section data of TS stream. I know this is posted by mpegtsparse element onto the bus.

 

But what i dont know is that, what is message type and how do i capture this data...?

 

Any clue...

 

-Ashwini

 

On Fri, Mar 11, 2011 at 12:53 PM, Ashwini Sharma <[hidden email]> wrote:

Thanks a ton Nathanael.

It worked for me.



 

On Fri, Mar 11, 2011 at 12:25 PM, Nathanael D. Noblet <[hidden email]> wrote:

On 03/10/2011 11:15 PM, Ashwini Sharma wrote:

Hi All,

I am trying to play a mp4 file. When I play from command line using the
pipe:
"gst-launch filesrc location=/home/ashwini/streams/output.ts !
mpegtsparse ! mpegtsdemux ! decodebin ! ffmpegcolorspace ! ximagesink"

The video is displayed well.
 But when i try to achieve the same pipe thru the application, It fails.

The code snippet of pipelie creation is as follows:

pipeline = gst_pipeline_new ("gst-player");
//gst_debug_set_default_threshold(GST_LEVEL_DEBUG);
gst_debug_set_threshold_for_name("mpegtsparse",GST_LEVEL_DEBUG);
    src = gst_element_factory_make ("filesrc", NULL);
    g_assert (src);
g_print("URI = %s\n",uri);
    g_object_set (G_OBJECT (src), "location", uri, NULL);
    parse = gst_element_factory_make ("mpegtsparse", NULL);
    g_assert (parse);
    demux = gst_element_factory_make ("mpegtsdemux", NULL);
    g_assert (demux);
    dec = gst_element_factory_make ("decodebin", NULL);
    g_assert (dec);
    csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
    g_assert (csp);
    videosink = gst_element_factory_make ("ximagesink", NULL);
    g_assert (videosink);

    /* Adding elements to the pipeline */
    gst_bin_add_many (GST_BIN (pipeline), src, parse, demux, dec, csp,
videosink, NULL);
    //  gst_bin_add_many (GST_BIN (pipeline), src, videosink, NULL);
   // g_assert (gst_element_link_many (src, parse, demux, dec, csp,
videosink, NULL));
    g_assert (gst_element_link (src, parse));
    g_assert (gst_element_link (parse, demux));
    gst_element_link (demux, dec);
    (gst_element_link (dec, csp));
    (gst_element_link (csp, videosink));
    if (GST_IS_X_OVERLAY (videosink))
    {
        gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink),
GPOINTER_TO_INT (window));
    }

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

What could be causing it to fail. (In the above snippet described, I
have used the gst-player code and modified the pipe to current state)

Any help is appreciated.

 

You need to listen for 'pad-added' signal from the decoder and check the gst_element_link() calls for success.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html

--
Nathanael d. Noblet
t 403.875.4613
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

 

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel