Multi pipeline logging identification

Marianna Smidth Buschle msb at qtec.com
Mon Dec 13 12:11:32 UTC 2021


I agree, this is what I have used.

As it has been mentioned you can do something like source.parent.name if 
you want the pipeline


def on_debug(category, level, dfile, dfctn, dline, source, message, 
user_data):
     if source:
         print('Debug {} {}: {}'.format(
             Gst.DebugLevel.get_name(level), source.name, message.get()))
     else:
         print('Debug {}: {}'.format(
             Gst.DebugLevel.get_name(level), message.get()))


And

         if not Gst.debug_is_active():
             Gst.debug_remove_log_function(None)
             Gst.debug_add_log_function(on_debug, None)
             level = Gst.debug_get_default_threshold()
             if level < Gst.DebugLevel.ERROR:
Gst.debug_set_default_threshold(Gst.DebugLevel.WARNING)
             Gst.debug_set_active(True)

             # Init GObject loop to handle Gstreamer Bus Events
             self.loop = GLib.MainLoop()
             try:
                 self.loop.run()
             except:
                 print("Exception gst")
                 for pipe in self.pipeline:
                     ret = pipe.set_state(Gst.State.NULL)
                 sys.exit(0)

This allows me to use gstreamer loging if I set GST_DEBUG="*:3" (or 
whatever level) or my own logging otherwise.

Prints something like:

Debug WARN    tcpserversink0: [socket 0x7f734028d670] client 0x7f733c001d20 is lagging at 5, recover using policy 1


Best regards

Marianna

On 11.12.2021 13.00, gstreamer-devel-request at lists.freedesktop.org wrote:
> Send gstreamer-devel mailing list submissions to
> 	gstreamer-devel at lists.freedesktop.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> or, via email, send a message with subject or body 'help' to
> 	gstreamer-devel-request at lists.freedesktop.org
>
> You can reach the person managing the list at
> 	gstreamer-devel-owner at lists.freedesktop.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gstreamer-devel digest..."
>
>
> Today's Topics:
>
>     1. Re: Multi pipeline logging identification (Michael Gruner)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Dec 2021 17:29:50 -0600
> From: Michael Gruner<michael.gruner at ridgerun.com>
> To: Discussion of the development of and with GStreamer
> 	<gstreamer-devel at lists.freedesktop.org>
> Cc: vinod kesti<vinodkesti at yahoo.com>, Dwight Kulkarni
> 	<dwight at realtime-7.com>
> Subject: Re: Multi pipeline logging identification
> Message-ID:<C6FDBE8B-D64A-4DA9-8334-6C51EB047F67 at ridgerun.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hey Vinod
>
> The only way I can think of achieving something similar is to implement your own custom log handlers. Check:
>
> https://gstreamer.freedesktop.org/documentation/gstreamer/gstinfo.html?gi-language=c#gst_debug_add_log_function
>
> Note that the callback handler receives the GstObject that generated the entry (may be null though). Having the element you can recursively find the topmost parent which will be the pipeline, if the element has been added to one already.
>
> Michael
> www.ridgerun.com  
>
>> On 10 Dec 2021, at 12:28, vinod kesti via gstreamer-devel<gstreamer-devel at lists.freedesktop.org>  wrote:
>>
>> ?
>> Hi all,
>>
>> I am running multiple Gstreamer pipelines in single linux process. All the pipelines are similar and only udp input and output ports are chanig.
>> Log function is Registered using gst_debug_add_log_function(),  after the gst_init(). I am not able to identify the which pipeline dumping the error.
>>
>> One way I found is if GObject is an GstElement/GstPad I am able to find the parent pipeline and dump the pipeline name. But I have facing problem when GObject in the callback is null. Is there any way to differentiate from which Pipeline we are getting warning.
>>
>>
>>
>>
>> Sent from Yahoo Mail. Get the app
>>
>>
>> On Thursday, 9 December, 2021, 06:56:44 pm GMT-6, Dwight Kulkarni via gstreamer-devel<gstreamer-devel at lists.freedesktop.org>  wrote:
>>
>>
>> Hi Vinod,
>>
>> I don't know enough about the debug log to help you with that, but it doesn't appear to be the right architecture to have multiple pipelines that are similar or same with udp different ports.
>>
>> I did use multiple pipelines and had to put all the similar elements into a single pipeline and then pull out data to multiple app sinks. Some source elements like v4l2src did not allow two pipelines to access them simultaneously (if memory serves).
>>
>> Best regards.
>>
>>
>> On Thu., Dec. 9, 2021, 4:16 p.m. vinod kesti,<vinodkesti at yahoo.com>  wrote:
>> Hi  Dwight Kulkarni,
>>
>> Thanks for responding. gst_bus_add_watch() handles messages. GST_ELEMENT_ERROR/WARNINGS are reported on the bus but not the GST_ERROR() and GST_WARNING().
>> Any help is appreciated thanks in advance.
>>
>>
>>
>>
>> Sent from Yahoo Mail. Get the app
>>
>>
>> On Thursday, 9 December, 2021, 02:22:29 pm GMT-6, Dwight Kulkarni via gstreamer-devel<gstreamer-devel at lists.freedesktop.org>  wrote:
>>
>>
>> Hi Vinod,
>>
>> You can try registering for the Bus messages with: gst_bus_add_watch(..)
>>
>> The GstMessage object returned can be queried for it's source object name.
>>
>>
>> On Thu, Dec 9, 2021 at 11:54 AM vinod kesti via gstreamer-devel<gstreamer-devel at lists.freedesktop.org>  wrote:
>> Hi all,
>>
>> I am running multiple Gstreamer pipelines in single linux process. All the pipelines are similar and only udp input and output ports are chanig.
>> Log function is Registered using gst_debug_add_log_function(),  after the gst_init(). I am not able to identify the which pipeline dumping the error.
>>
>> One way I found is if GObject is an GstElement/GstPad I am able to find the parent pipeline and dump the pipeline name. But I have facing problem when GObject in the callback is null. Is there any way to differentiate from which Pipeline we are getting warning.
>>
>>
>>
>> Sent from Yahoo Mail. Get the app
>>
>>
>> -- 
>> Sincerely,
>>
>> Dwight Kulkarni
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:<https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211210/20bea73e/attachment-0001.htm>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> ------------------------------
>
> End of gstreamer-devel Digest, Vol 131, Issue 14
> ************************************************

-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211213/0a5afe5a/attachment.htm>


More information about the gstreamer-devel mailing list