Gstreamer - decodebin - program number

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

Gstreamer - decodebin - program number

Duchassin Frederic

Hello,

 

I try to use gstreamer to decode a TS file.

I use decodebin because it’s fantastic to automatically detect to decoder, parser…needed !

My TS file can contain H264 video or mpeg2, and audio could be dolby, aac, mpeg1…. So decodebin is perfect to construct the pipeline.

But my main problem is that I would like to change the program number to decode ?

 

Do you know a way to do this ?

 

(tsdemux can do that this with “program_number”  but I can’t put tsdemux before decodebin. It doesn’t work)

 

 

Salutations / Best Regards

-----------------------------------------------------------------

 

Fred

 


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

Re: Gstreamer - decodebin - program number

Nicolas Dufresne-5
Le vendredi 21 juillet 2017 à 13:25 +0000, Duchassin Frédéric a écrit :

Hello,

 

I try to use gstreamer to decode a TS file.

I use decodebin because it’s fantastic to automatically detect to decoder, parser…needed !

My TS file can contain H264 video or mpeg2, and audio could be dolby, aac, mpeg1…. So decodebin is perfect to construct the pipeline.

But my main problem is that I would like to change the program number to decode ?

 

Do you know a way to do this ?

 

(tsdemux can do that this with “program_number”  but I can’t put tsdemux before decodebin. It doesn’t work)


decodebin has a signal called "autoplug-select". Also, the tsdemux property is named "program-number" with a -.

 

 

Salutations / Best Regards

-----------------------------------------------------------------

 

Fred

 

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

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

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Gstreamer - decodebin - program number

Duchassin Frederic

Hello,

 

Thanks a lot for your answer.

Of course about tsdemux property, it’s mistake from my side.

Can you explain me more about autoplug-select please ? I don’t really understand how to give the program-number to the child of decodebin.

 

BR

 

Frederic

 

De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : vendredi 21 juillet 2017 20:14
À : Discussion of the development of and with GStreamer
Objet : Re: Gstreamer - decodebin - program number

 

Le vendredi 21 juillet 2017 à 13:25 +0000, Duchassin Frédéric a écrit :

Hello,

 

I try to use gstreamer to decode a TS file.

I use decodebin because it’s fantastic to automatically detect to decoder, parser…needed !

My TS file can contain H264 video or mpeg2, and audio could be dolby, aac, mpeg1…. So decodebin is perfect to construct the pipeline.

But my main problem is that I would like to change the program number to decode ?

 

Do you know a way to do this ?

 

(tsdemux can do that this with “program_number”  but I can’t put tsdemux before decodebin. It doesn’t work)

 

decodebin has a signal called "autoplug-select". Also, the tsdemux property is named "program-number" with a -.

 

 

 

 

Salutations / Best Regards

-----------------------------------------------------------------

 

Fred

 

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

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

RE: Gstreamer - decodebin - program number

Duchassin Frederic
In reply to this post by Nicolas Dufresne-5

Hello,

 

I found very poor documentation or examples with “autoplug-select” signal but I try to selectr the right stream with this code :

 

static GstAutoplugSelectResult cb_autoplug_select (GstElement      *bin,

                       GstPad            *pad,

                       GstCaps           *caps,

                       GstElementFactory *factory,

                       gpointer           user_data)

{

    gchar * capsstr = gst_caps_to_string (caps);

    gchar * factorynamestr = GST_OBJECT_NAME (factory);

 

    g_print ("autoplug-select %s: %s", factorynamestr, capsstr);

 

    if(strcmp(factorynamestr, "tsdemux") == 0) //tsdemux used

        {

            int val = 21;

        g_object_set(G_OBJECT(factory), "program-number ", val, NULL);

        }

 

    /* Try factory. */

    return GST_AUTOPLUG_SELECT_TRY;

}

 

But it doesn’t work !

Message receive is :

(QML_LibpcapGstreamerUart:802): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstElementFactory' has no property named 'program-number '

 

Have you got an idea about the problem ?

 

Fred

 

 

 

 

 

De : gstreamer-devel [mailto:[hidden email]] De la part de Nicolas Dufresne
Envoyé : vendredi 21 juillet 2017 20:14
À : Discussion of the development of and with GStreamer
Objet : Re: Gstreamer - decodebin - program number

 

Le vendredi 21 juillet 2017 à 13:25 +0000, Duchassin Frédéric a écrit :

Hello,

 

I try to use gstreamer to decode a TS file.

I use decodebin because it’s fantastic to automatically detect to decoder, parser…needed !

My TS file can contain H264 video or mpeg2, and audio could be dolby, aac, mpeg1…. So decodebin is perfect to construct the pipeline.

But my main problem is that I would like to change the program number to decode ?

 

Do you know a way to do this ?

 

(tsdemux can do that this with “program_number”  but I can’t put tsdemux before decodebin. It doesn’t work)

 

decodebin has a signal called "autoplug-select". Also, the tsdemux property is named "program-number" with a -.

 

 

 

 

Salutations / Best Regards

-----------------------------------------------------------------

 

Fred

 

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

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

Re: Gstreamer - decodebin - program number

Tim Müller
On Wed, 2017-07-26 at 11:30 +0200, Duchassin Frederic wrote:

Hi Fred,

I don't think this will work. You need to set this property on the
actual GstElement, not a GstElementFactory.

If you were using playbin you could have used the (newish) "element-
setup" signal for this.

With decodebin, you can use the "element-added" signal. Only problem is
that this will be emitted for all elements that are added to decodebin,
so you need to make sure you only set this property on the ts demuxer.

One way of doing this check is just checking for the property with
something like:

  if (g_object_class_find_property (G_OBJECT_GET_CLASS (added_element),
"program-number")) {
    g_object_set (added_element, "program-number", ..., NULL);
  }

Or you get the factory from the element and then check the factory
name.

Cheers
 -Tim


--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: Gstreamer - decodebin - program number

Duchassin Frederic
Hi Tim,

Thanks for the explanation.
This is the code is use :

void element_added_cb (GstBin *bin, GstElement *element, gpointer user_data)
{
    gchar * name = GST_OBJECT_NAME (element);

    g_print ("element-added: %s\r\n", name);

    if (g_object_class_find_property (G_OBJECT_GET_CLASS (element),"program-number"))
        {
            int val = 22;
        g_object_set(G_OBJECT(element), "program-number ", val, NULL);
        }

}

But I always get an error on output :

element-added: tsdemux0
(QML_LibpcapGstreamerUart:1083): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstTSDemux' has no property named 'program-number '
element-added: multiqueue0
element-added: mpegaudioparse0
element-added: mpegvparse0
element-added: mad0
element-added: imxvpudecoder0

It's strange isn't ?


Fred



-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Tim Müller
Envoyé : mercredi 26 juillet 2017 12:34
À : [hidden email]
Objet : Re: Gstreamer - decodebin - program number

On Wed, 2017-07-26 at 11:30 +0200, Duchassin Frederic wrote:

Hi Fred,

I don't think this will work. You need to set this property on the actual GstElement, not a GstElementFactory.

If you were using playbin you could have used the (newish) "element- setup" signal for this.

With decodebin, you can use the "element-added" signal. Only problem is that this will be emitted for all elements that are added to decodebin, so you need to make sure you only set this property on the ts demuxer.

One way of doing this check is just checking for the property with something like:

  if (g_object_class_find_property (G_OBJECT_GET_CLASS (added_element),
"program-number")) {
    g_object_set (added_element, "program-number", ..., NULL);
  }

Or you get the factory from the element and then check the factory name.

Cheers
 -Tim


--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: Gstreamer - decodebin - program number

Tim Müller
On Wed, 2017-07-26 at 14:13 +0200, Duchassin Frederic wrote:

Hi,

> g_object_set(G_OBJECT(element), "program-number ", val, NULL);
>
> (QML_LibpcapGstreamerUart:1083): GLib-GObject-WARNING **:
> g_object_set_valist: object class 'GstTSDemux' has no property named
> 'program-number '
>
> It's strange isn't ?

There's an extraneous space at the end of your property name string :)

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: Gstreamer - decodebin - program number

Duchassin Frederic
Oh yes....
Many many thanks. It's a beginner mistake ;-((((

Thanks a lot for your help.
BR

Fred



-----Message d'origine-----
De : gstreamer-devel [mailto:[hidden email]] De la part de Tim Müller
Envoyé : mercredi 26 juillet 2017 14:43
À : [hidden email]
Objet : Re: Gstreamer - decodebin - program number

On Wed, 2017-07-26 at 14:13 +0200, Duchassin Frederic wrote:

Hi,

> g_object_set(G_OBJECT(element), "program-number ", val, NULL);
>
> (QML_LibpcapGstreamerUart:1083): GLib-GObject-WARNING **:
> g_object_set_valist: object class 'GstTSDemux' has no property named
> 'program-number '
>
> It's strange isn't ?

There's an extraneous space at the end of your property name string :)

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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