Playing a video in a GTK window example

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

Playing a video in a GTK window example

pisymbol .
Is there ANY example out there that is known to work with the current API bindings?

I have Googled and Googled some more and have tried several examples located in github etc and either a) they are for an older API or b) simply no longer work as designed.

Does anyone have a code sample that uses either playbin, uridecode, or some custom pipeline that doesn't include videotestsrc (the only plugin I have successfully gotten to play in a window)?

Thanks!

-aps

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

Re: Playing a video in a GTK window example

Guillaume Desmottes-2

Hi there,

The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
should be helpful to you.


    G.

On 12/06/2019 04:19, pisymbol . wrote:
Is there ANY example out there that is known to work with the current API bindings?

I have Googled and Googled some more and have tried several examples located in github etc and either a) they are for an older API or b) simply no longer work as designed.

Does anyone have a code sample that uses either playbin, uridecode, or some custom pipeline that doesn't include videotestsrc (the only plugin I have successfully gotten to play in a window)?

Thanks!

-aps

_______________________________________________
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: Playing a video in a GTK window example

pisymbol .


On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <[hidden email]> wrote:

Hi there,

The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
should be helpful to you.

Great! I know them. Now an example that uses them? :-)

-aps

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

Re: Playing a video in a GTK window example

Philippe Normand
On Wed, 2019-06-12 at 09:20 -0400, pisymbol . wrote:

> On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <
> [hidden email]> wrote:
>
> > Hi there,
> >
> > The gtksink and gtkglsink in
> > https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
> > should be helpful to you.
> >
> Great! I know them. Now an example that uses them? :-)
>
>

Those files *are* examples.

Philippe

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

Re: Playing a video in a GTK window example

pisymbol .
In reply to this post by pisymbol .


On Wed, Jun 12, 2019 at 9:20 AM pisymbol . <[hidden email]> wrote:


On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <[hidden email]> wrote:

Hi there,

The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
should be helpful to you.

Great! I know them. Now an example that uses them? :-)


Full disclosure: I have now gotten it to work from a tip by Mattias. My point though is that in order to link videoconvert to gtksink you need to expose videoconverts src as a ghost pad which is no where to be found in the documentation.

What worked for me (the missing link - literally):

ghostpad = Gst.Ghostpad.new("sink", videoconveter_element.get_static_pad('src'))
bin.add_pad(ghotspad)

And then I was able to link in gtksink and pack it using gtksink.props.widget. This stuff needs to be documented since the overwhelming majorities that turn up on Google simply do not work with the current API.

-aps

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

Re: Playing a video in a GTK window example

pisymbol .
In reply to this post by Philippe Normand


On Wed, Jun 12, 2019 at 9:50 AM Philippe Normand <[hidden email]> wrote:
On Wed, 2019-06-12 at 09:20 -0400, pisymbol . wrote:
> On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <
> [hidden email]> wrote:
>
> > Hi there,
> >
> > The gtksink and gtkglsink in
> > https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
> > should be helpful to you.
> >
> Great! I know them. Now an example that uses them? :-)
>
>

Those files *are* examples.

Not in "python" though! And it uses videotestsrc which is kinda lame. For real pipelines that use videoconvert and such, I can not find any official examples. I noticed the doc page has a "Language" option - is that just for the Core API reference or is that suppose to translate to the Tutorial as well?

-aps

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

Re: Playing a video in a GTK window example

Nicolas Dufresne-5
In reply to this post by pisymbol .
Le mercredi 12 juin 2019 à 09:42 -0400, pisymbol . a écrit :

>
>
> On Wed, Jun 12, 2019 at 9:20 AM pisymbol . <[hidden email]> wrote:
> >
> > On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <[hidden email]> wrote:
> > > Hi there,
> > > The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
> > > should be helpful to you.
> > >
> >
> > Great! I know them. Now an example that uses them? :-)
> >
> >
>
> Full disclosure: I have now gotten it to work from a tip by Mattias. My point though is that in order to link videoconvert to gtksink you need to expose videoconverts src as a ghost pad which is no where to be found in the documentation.
>
> What worked for me (the missing link - literally):
>
> ghostpad = Gst.Ghostpad.new("sink", videoconveter_element.get_static_pad('src'))
> bin.add_pad(ghotspad)
>
> And then I was able to link in gtksink and pack it using gtksink.props.widget. This stuff needs to be documented since the overwhelming majorities that turn up on Google simply do not work with the current API.
Ghosting is not specific to using gtksink. If you use custom bins with
pads, you have to learn how to ghost the pads.

>
> -aps
> _______________________________________________
> 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: Playing a video in a GTK window example

pisymbol .


On Wed, Jun 12, 2019 at 10:22 AM Nicolas Dufresne <[hidden email]> wrote:
Le mercredi 12 juin 2019 à 09:42 -0400, pisymbol . a écrit :
>
>
> On Wed, Jun 12, 2019 at 9:20 AM pisymbol . <[hidden email]> wrote:
> >
> > On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <[hidden email]> wrote:
> > > Hi there,
> > > The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
> > > should be helpful to you.
> > >
> >
> > Great! I know them. Now an example that uses them? :-)
> >
> >
>
> Full disclosure: I have now gotten it to work from a tip by Mattias. My point though is that in order to link videoconvert to gtksink you need to expose videoconverts src as a ghost pad which is no where to be found in the documentation.
>
> What worked for me (the missing link - literally):
>
> ghostpad = Gst.Ghostpad.new("sink", videoconveter_element.get_static_pad('src'))
> bin.add_pad(ghotspad)
>
> And then I was able to link in gtksink and pack it using gtksink.props.widget. This stuff needs to be documented since the overwhelming majorities that turn up on Google simply do not work with the current API.

Ghosting is not specific to using gtksink. If you use custom bins with
pads, you have to learn how to ghost the pads.

Totally agreed. But how would you use videoconvert to gtksink in PyGst?

Here's the thing:

gst-launch-1.0 filesrc location="blah" ! videoconvert ! gtksink

Just works. But if you use the parse_bin_from_description() API you then have to ghost pad out videoconvert to gtksink to make it actually display something. I understand why now but there are like ZERO examples of this idiom anywhere I could find by simply Googling. Mattias was kind of enough to suggest this and ti worked.

The bottom line is most of the examples out there are just flat out wrong. Shouldn't the official gstreamer doc be a bit more comprehensive in this regard? At leaat on the Python side? I'm just asking. I'm not excusing any one of being lazy. Though maybe I didn't read the doc thoroughly enough and I do apologize in advance if that is the case.

-aps

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

Re: Playing a video in a GTK window example

pisymbol .


On Wed, Jun 12, 2019 at 10:52 AM pisymbol . <[hidden email]> wrote:

 I'm not excusing any one of being lazy.

Freudian slip!  Or maybe just GMail? LOL!

-aps

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

Re: Playing a video in a GTK window example

Nicolas Dufresne-5
In reply to this post by pisymbol .
Le mercredi 12 juin 2019 à 10:52 -0400, pisymbol . a écrit :


On Wed, Jun 12, 2019 at 10:22 AM Nicolas Dufresne <[hidden email]> wrote:
Le mercredi 12 juin 2019 à 09:42 -0400, pisymbol . a écrit :
>
>
> On Wed, Jun 12, 2019 at 9:20 AM pisymbol . <[hidden email]> wrote:
> >
> > On Tue, Jun 11, 2019 at 11:19 PM Guillaume Desmottes <[hidden email]> wrote:
> > > Hi there,
> > > The gtksink and gtkglsink in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/tree/master/tests/examples/gtk
> > > should be helpful to you.
> > >
> >
> > Great! I know them. Now an example that uses them? :-)
> >
> >
>
> Full disclosure: I have now gotten it to work from a tip by Mattias. My point though is that in order to link videoconvert to gtksink you need to expose videoconverts src as a ghost pad which is no where to be found in the documentation.
>
> What worked for me (the missing link - literally):
>
> ghostpad = Gst.Ghostpad.new("sink", videoconveter_element.get_static_pad('src'))
> bin.add_pad(ghotspad)
>
> And then I was able to link in gtksink and pack it using gtksink.props.widget. This stuff needs to be documented since the overwhelming majorities that turn up on Google simply do not work with the current API.

Ghosting is not specific to using gtksink. If you use custom bins with
pads, you have to learn how to ghost the pads.


Totally agreed. But how would you use videoconvert to gtksink in PyGst?

Here's the thing:

gst-launch-1.0 filesrc location="blah" ! videoconvert ! gtksink

Just works. But if you use the parse_bin_from_description() API you then have to ghost pad out videoconvert to gtksink to make it actually display something. I understand why now but there are like ZERO examples of this idiom anywhere I could find by simply Googling. Mattias was kind of enough to suggest this and ti worked.

Ah, now I'm starting to see what you are doing, in absence of code, it's hard to understand fully. See Micheal next reply. Something similar to this is easier, I've used v4l2src as you seem to very dislike videotestsrc ;-P

   p = Gst.parse_launch("v4l2src ! videoconvert ! gtksink name=sink")                                             
   s = p.get_by_name("sink")
   box.pack_start(s.props.widget, ...)



The bottom line is most of the examples out there are just flat out wrong. Shouldn't the official gstreamer doc be a bit more comprehensive in this regard? At leaat on the Python side? I'm just asking. I'm not excusing any one of being lazy. Though maybe I didn't read the doc thoroughly enough and I do apologize in advance if that is the case.

-aps
_______________________________________________
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