class_docstr: WebM encoder based on Gstreamer
class_docstr_tok: ["WebM","encoder","based","on","Gstreamer"]
code: def setup(
      self,
      channels=None,
      samplerate=None,
      blocksize=None,
      totalframes=None,
  ):
      super(WebMEncoder, self).setup(
          channels, samplerate, blocksize, totalframes
      )
      from numpy import ceil
  
      framerate = 30
      num_buffers = ceil(
          self.mediainfo()["duration"] * framerate
      ).astype(int)
      self.pipe = ""
      if self.video:
          self.pipe += (
              """videotestsrc pattern=black num_buffers=%d ! videoconvert ! queue ! vp8enc ! queue ! mux.
                           """
              % num_buffers
          )
      self.pipe += """
                appsrc name=src ! queue ! audioconvert ! vorbisenc quality=0.9 ! queue ! mux.
                webmmux streamable=true name=mux
                    """
      if self.filename and self.streaming:
          self.pipe += (
              """ ! tee name=t
              ! queue ! filesink location=%s
              t. ! queue ! appsink name=app sync=False
              """
              % self.filename
          )
  
      elif self.filename:
          self.pipe += (
              "! filesink location=%s async=False sync=False "
              % self.filename
          )
      else:
          self.pipe += "! queue ! appsink name=app sync=False "
  
      self.start_pipeline(channels, samplerate)
  
file_path: TimeSide/timeside/plugins/encoder/webm.py
imports: from timeside.core import implements, interfacedoc
  from timeside.core.encoder import GstEncoder
  from timeside.core.api import IEncoder
label_desc: Use image node_id 2 for calling the WebMEncoder obj's underlying member method code with example usage: obj.setup(channels, samplerate, blocksize, totalframes) without return types