Can't get appsink to emit new-sample?

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

Can't get appsink to emit new-sample?

pisymbol .
Pipeline snippet:

... ! omxh264enc control-rate=2 bitrate=30000000 ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! appsink name=appsink0 emit-signals=true

I am then using:

appsink0 = recorder_bin.get_by_name("appsink0")
appsink0.connect("new-sample", on_new_sample, 0)

def on_new_sample(sensor_id):
   """ Why is this so hard? """
   print(sensor_id)
   return Gst.FlowReturn.OK

Is there something else I should be doing to get appsink to emit the 'new-sample' callback? I do have an appsrc0 somewhere else I plan to send buffers I catch in appsink0 to but I'm not sure that is relevant here.

-aps

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

Re: Can't get appsink to emit new-sample?

Nicolas Dufresne-5
Le vendredi 02 août 2019 à 12:59 -0400, pisymbol . a écrit :

> Pipeline snippet:
>
> ... ! omxh264enc control-rate=2 bitrate=30000000 ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! appsink name=appsink0 emit-signals=true
>
> I am then using:
>
> appsink0 = recorder_bin.get_by_name("appsink0")
> appsink0.connect("new-sample", on_new_sample, 0)
>
> def on_new_sample(sensor_id):
>    """ Why is this so hard? """
>    print(sensor_id)
>    return Gst.FlowReturn.OK
>
> Is there something else I should be doing to get appsink to emit the 'new-sample' callback? I do have an appsrc0 somewhere else I plan to send buffers I catch in appsink0 to but I'm not sure that is relevant here.
In python, you are better to use polling to get the buffers, as the
signal will slow down everything due to Python interpreter lock.

>
> -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: Can't get appsink to emit new-sample?

pisymbol .


On Fri, Aug 2, 2019 at 1:21 PM Nicolas Dufresne <[hidden email]> wrote:
Le vendredi 02 août 2019 à 12:59 -0400, pisymbol . a écrit :
> Pipeline snippet:
>
> ... ! omxh264enc control-rate=2 bitrate=30000000 ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! appsink name=appsink0 emit-signals=true
>
> I am then using:
>
> appsink0 = recorder_bin.get_by_name("appsink0")
> appsink0.connect("new-sample", on_new_sample, 0)
>
> def on_new_sample(sensor_id):
>    """ Why is this so hard? """
>    print(sensor_id)
>    return Gst.FlowReturn.OK
>
> Is there something else I should be doing to get appsink to emit the 'new-sample' callback? I do have an appsrc0 somewhere else I plan to send buffers I catch in appsink0 to but I'm not sure that is relevant here.

In python, you are better to use polling to get the buffers, as the
signal will slow down everything due to Python interpreter lock.

Ah! Bit again by the GIL. 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: Can't get appsink to emit new-sample?

Michael Gruner
In reply to this post by pisymbol .
One possibility is that you don’t have a main  loop iterating. Signals only get emitted if you iterate contexts.

Michael

> On Aug 2, 2019, at 10:59 AM, pisymbol . <[hidden email]> wrote:
>
> Pipeline snippet:
>
> ... ! omxh264enc control-rate=2 bitrate=30000000 ! video/x-h264, stream-format=(string)byte-stream ! h264parse ! appsink name=appsink0 emit-signals=true
>
> I am then using:
>
> appsink0 = recorder_bin.get_by_name("appsink0")
> appsink0.connect("new-sample", on_new_sample, 0)
>
> def on_new_sample(sensor_id):
>    """ Why is this so hard? """
>    print(sensor_id)
>    return Gst.FlowReturn.OK
>
> Is there something else I should be doing to get appsink to emit the 'new-sample' callback? I do have an appsrc0 somewhere else I plan to send buffers I catch in appsink0 to but I'm not sure that is relevant here.
>
> -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: Can't get appsink to emit new-sample?

pisymbol .


On Fri, Aug 2, 2019 at 11:19 PM Michael Gruner <[hidden email]> wrote:
One possibility is that you don’t have a main  loop iterating. Signals only get emitted if you iterate contexts.

Why would say identity callbacks work as well as mfsink messages work in my app but not appsink though?

-aps

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

Re: Can't get appsink to emit new-sample?

Michael Gruner
Yep, that was an out of context answer, didn’t notice the on-going discussion.

On Aug 2, 2019, at 9:48 PM, pisymbol . <[hidden email]> wrote:



On Fri, Aug 2, 2019 at 11:19 PM Michael Gruner <[hidden email]> wrote:
One possibility is that you don’t have a main  loop iterating. Signals only get emitted if you iterate contexts.

Why would say identity callbacks work as well as mfsink messages work in my app but not appsink though?

-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: Can't get appsink to emit new-sample?

Nicolas Dufresne-5
In reply to this post by pisymbol .
Le vendredi 02 août 2019 à 23:48 -0400, pisymbol . a écrit :
>
>
> On Fri, Aug 2, 2019 at 11:19 PM Michael Gruner <[hidden email]> wrote:
> > One possibility is that you don’t have a main  loop iterating. Signals only get emitted if you iterate contexts.
> >
>
> Why would say identity callbacks work as well as mfsink messages work in my app but not appsink though?

Identity handoff is as bad on performance as the appsink callback. I
don't know what mfsink is.

>
> -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: Can't get appsink to emit new-sample?

pisymbol .


On Sat, Aug 3, 2019, 8:59 AM Nicolas Dufresne <[hidden email]> wrote:
Le vendredi 02 août 2019 à 23:48 -0400, pisymbol . a écrit :
>
>
> On Fri, Aug 2, 2019 at 11:19 PM Michael Gruner <[hidden email]> wrote:
> > One possibility is that you don’t have a main  loop iterating. Signals only get emitted if you iterate contexts.
> >
>
> Why would say identity callbacks work as well as mfsink messages work in my app but not appsink though?

Identity handoff is as bad on performance as the appsink callback. I
don't know what mfsink 

Multifilesink's bus message when a file rollover event occurs.

-aps

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

Re: Can't get appsink to emit new-sample?

Sebastian Dröge-3
In reply to this post by Michael Gruner
On Fri, 2019-08-02 at 21:18 -0600, Michael Gruner wrote:
> One possibility is that you don’t have a main  loop iterating.
> Signals only get emitted if you iterate contexts.

That's wrong. Signal handlers are called from whatever thread is
emitting them, and appsink does not require any GLib main context.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


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

signature.asc (981 bytes) Download Attachment