How to I enable latencytracer in Python?

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

How to I enable latencytracer in Python?

Michael-2

Hello everybody,


I wanna investigate latency issues in my pipeline!

I found that using Tracers should be the way to go with `latencytracer`, but ...
I couldn't find any example except using it in `gst-launch-1.0`

GST_DEBUG="GST_TRACER:7" GST_TRACERS=latency(flags=element)
How would I enable it in a python script?  🤷‍♂️

GST_TRACERS=latency(flags=element)

Finding a way for debugging wasn't that easy starting from zero.

Gst.debug_set_active(True)
#Gst.debug_set_default_threshold(4)
#Gst.debug_set_threshold_for_name('test*', Gst.DebugLevel.TRACE )
#Gst.debug_set_threshold_for_name("qt*", 5)

But how would I trace the latency for each Element in the current pipe during runtime, in python?

Thank you in advance.

Michael



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

Re: How to I enable latencytracer in Python?

Nicolas Dufresne-5
Le samedi 02 mai 2020 à 19:01 +0200, Michael a écrit :

>
> Hello everybody,
>
>
> I wanna investigate latency issues in my pipeline!
>
> I found that using Tracers should be the way to go with `latencytracer`, but
> ...
> I couldn't find any example except using it in `gst-launch-1.0`
>
> GST_DEBUG="GST_TRACER:7" GST_TRACERS=latency(flags=element)
> How would I enable it in a python script?  🤷‍♂️
>
> GST_TRACERS=latency(flags=element)
>
> Finding a way for debugging wasn't that easy starting from zero.
>
> Gst.debug_set_active(True)
> #Gst.debug_set_default_threshold(4)
> #Gst.debug_set_threshold_for_name('test*', Gst.DebugLevel.TRACE  )
> #Gst.debug_set_threshold_for_name("qt*", 5)
>
> But how would I trace the latency for each Element in the current pipe during
> runtime, in python?

There is currently no API to the tracers, this is something we should do, we we
already have few bits marked as unstable API because their API isn't yet in a
shape we are confident to freeze it.

From the time being, you need to set the env before starting the process or do
this before calling Gst.init():

        os.environ["GST_TRACERS"] = "latency(flags=element)"

There is no way to turn on and off at run-time for now.

>
> Thank you in advance.
>
> Michael
>
>
> _______________________________________________
> 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: How to I enable latencytracer in Python?

Tim-Philipp Müller-2
On Sat, 2020-05-02 at 17:00 -0400, Nicolas Dufresne wrote:

There is currently no API to the tracers, this is something we should do, we we
already have few bits marked as unstable API because their API isn't yet in a
shape we are confident to freeze it.

From the time being, you need to set the env before starting the process or do
this before calling Gst.init():

	os.environ["GST_TRACERS"] = "latency(flags=element)"

There is no way to turn on and off at run-time for now.

FWIW, we do have API access for tracers in git master, e.g. the leak
tracer can be accessed via GObject API after retrieving it via
gst_tracing_get_active_tracers(), to do snapshotting etc. So could
add something similar to other tracers if we wanted to and it seems
useful.

Cheers
 Tim

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

Re: How to I enable latencytracer in Python?

Michael-2
In reply to this post by Nicolas Dufresne-5
Thank you Nicolas, will do!

Am Sa., 2. Mai 2020 um 23:00 Uhr schrieb Nicolas Dufresne <[hidden email]>:
Le samedi 02 mai 2020 à 19:01 +0200, Michael a écrit :
>
> Hello everybody,
>
>
> I wanna investigate latency issues in my pipeline!
>
> I found that using Tracers should be the way to go with `latencytracer`, but
> ...
> I couldn't find any example except using it in `gst-launch-1.0`
>
> GST_DEBUG="GST_TRACER:7" GST_TRACERS=latency(flags=element)
> How would I enable it in a python script?  🤷‍♂️
>
> GST_TRACERS=latency(flags=element)
>
> Finding a way for debugging wasn't that easy starting from zero.
>
> Gst.debug_set_active(True)
> #Gst.debug_set_default_threshold(4)
> #Gst.debug_set_threshold_for_name('test*', Gst.DebugLevel.TRACE  )
> #Gst.debug_set_threshold_for_name("qt*", 5)
>
> But how would I trace the latency for each Element in the current pipe during
> runtime, in python?

There is currently no API to the tracers, this is something we should do, we we
already have few bits marked as unstable API because their API isn't yet in a
shape we are confident to freeze it.

From the time being, you need to set the env before starting the process or do
this before calling Gst.init():

        os.environ["GST_TRACERS"] = "latency(flags=element)"

There is no way to turn on and off at run-time for now.

>
> Thank you in advance.
>
> Michael
>
>
> _______________________________________________
> 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

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

Re: How to I enable latencytracer in Python?

Nicolas Dufresne-5
In reply to this post by Tim-Philipp Müller-2


Le dim. 3 mai 2020 06 h 30, Tim-Philipp Müller <[hidden email]> a écrit :
On Sat, 2020-05-02 at 17:00 -0400, Nicolas Dufresne wrote:

There is currently no API to the tracers, this is something we should do, we we
already have few bits marked as unstable API because their API isn't yet in a
shape we are confident to freeze it.

From the time being, you need to set the env before starting the process or do
this before calling Gst.init():

	os.environ["GST_TRACERS"] = "latency(flags=element)"

There is no way to turn on and off at run-time for now.

FWIW, we do have API access for tracers in git master, e.g. the leak
tracer can be accessed via GObject API after retrieving it via
gst_tracing_get_active_tracers(), to do snapshotting etc. So could
add something similar to other tracers if we wanted to and it seems
useful.

Yes, though the leak tracer still need to be activated by env iirc. The leak tracer can only work if it's enabled before gst_init(). While some other tracers, like latency tracer could with some API be activated and deactivated completely at runtime (without paying an overhead when deactivated). Just saying, as it would be sad to use the same API for these two cases.

Cheers
 Tim
_______________________________________________
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: How to I enable latencytracer in Python?

Michael-2
Hello gentlemen,

me again ...

I just did this before Gst.init()

os.environ["GST_DEBUG"] = "GST_TRACER:7"
os.environ["GST_TRACERS"] = "latency(flags=element)"

But nothing happens in the stdout. 🤷‍♂️

If I try

Gst.debug_set_active(True)
Gst.debug_set_default_threshold(7)
os.environ["GST_TRACERS"] = "latency(flags=element)"

I get all the Traces as expected even without setting the GST_TRACERS env ?

I am a bit confused what should I see in the stdout if that would work?

Thanks, Michael

 

Am So., 3. Mai 2020 um 15:52 Uhr schrieb Nicolas Dufresne <[hidden email]>:


Le dim. 3 mai 2020 06 h 30, Tim-Philipp Müller <[hidden email]> a écrit :
On Sat, 2020-05-02 at 17:00 -0400, Nicolas Dufresne wrote:

There is currently no API to the tracers, this is something we should do, we we
already have few bits marked as unstable API because their API isn't yet in a
shape we are confident to freeze it.

From the time being, you need to set the env before starting the process or do
this before calling Gst.init():

	os.environ["GST_TRACERS"] = "latency(flags=element)"

There is no way to turn on and off at run-time for now.

FWIW, we do have API access for tracers in git master, e.g. the leak
tracer can be accessed via GObject API after retrieving it via
gst_tracing_get_active_tracers(), to do snapshotting etc. So could
add something similar to other tracers if we wanted to and it seems
useful.

Yes, though the leak tracer still need to be activated by env iirc. The leak tracer can only work if it's enabled before gst_init(). While some other tracers, like latency tracer could with some API be activated and deactivated completely at runtime (without paying an overhead when deactivated). Just saying, as it would be sad to use the same API for these two cases.

Cheers
 Tim
_______________________________________________
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

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