code: def get_media_uri_info(uri):
      import gi
  
      gi.require_version("Gst", "1.0")
      gi.require_version("GLib", "2.0")
      from gi.repository import Gst, GLib
  
      Gst.init(None)
      gi.require_version("GstPbutils", "1.0")
      from gi.repository.GstPbutils import Discoverer
  
      GST_DISCOVER_TIMEOUT = 5000000000
      uri_discoverer = Discoverer.new(GST_DISCOVER_TIMEOUT)
      try:
          uri_info = uri_discoverer.discover_uri(uri)
      except GLib.GError as e:
          raise IOError(e)
      info = dict()
  
      # Duration in seconds
      info["duration"] = uri_info.get_duration() / Gst.SECOND
  
      audio_streams = uri_info.get_audio_streams()
      info["streams"] = []
      for stream in audio_streams:
          stream_info = {
              "bitrate": stream.get_bitrate(),
              "channels": stream.get_channels(),
              "depth": stream.get_depth(),
              "max_bitrate": stream.get_max_bitrate(),
              "samplerate": stream.get_sample_rate(),
          }
          info["streams"].append(stream_info)
  
      # print('discovered', uri, info)
      return info
  
file_path: TimeSide/timeside/plugins/decoder/utils.py
imports: from __future__ import division
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: get_media_uri_info(uri) and returns: info