class_docstr: StreamGear automates transcoding workflow for generating Ultra-Low Latency, High-Quality, Dynamic & Adaptive Streaming Formats (such as MPEG-DASH and HLS) in just few lines of python code.
  StreamGear provides a standalone, highly extensible, and flexible wrapper around FFmpeg multimedia framework for generating chunked-encoded media segments of the content.
  
  SteamGear easily transcodes source videos/audio files & real-time video-frames and breaks them into a sequence of multiple smaller chunks/segments of suitable length. These segments make it
  possible to stream videos at different quality levels (different bitrates or spatial resolutions) and can be switched in the middle of a video from one quality level to another – if bandwidth
  permits – on a per-segment basis. A user can serve these segments on a web server that makes it easier to download them through HTTP standard-compliant GET requests.
  
  SteamGear also creates a Manifest/Playlist file (such as MPD in-case of DASH and M3U8 in-case of HLS) besides segments that describe these segment information (timing, URL, media characteristics like video resolution and bit rates)
   and is provided to the client before the streaming session.
  
  SteamGear currently supports MPEG-DASH (Dynamic Adaptive Streaming over HTTP, ISO/IEC 23009-1) and Apple HLS (HTTP live streaming).
docstr: Pipelines `ndarray` frames to FFmpeg Pipeline for transcoding into multi-bitrate streamable assets.
  
  Parameters:
      frame (ndarray): a valid numpy frame
      rgb_mode (boolean): enable this flag to activate RGB mode _(i.e. specifies that incoming frames are of RGB format instead of default BGR)_.
docstr_tok: ["Pipelines","`","ndarray","`","frames","to","FFmpeg","Pipeline","for","transcoding","into","multi-bitrate","streamable","assets",".","Parameters",":","frame","(","ndarray",")",":","a","valid","numpy","frame","rgb_mode","(","boolean",")",":","enable","this","flag","to","activate","RGB","mode","_","(","i.e",".","specifies","that","incoming","frames","are","of","RGB","format","instead","of","default","BGR",")","_","."]
code: def stream(self, frame, rgb_mode=False):
      """
      Pipelines `ndarray` frames to FFmpeg Pipeline for transcoding into multi-bitrate streamable assets.
  
      Parameters:
          frame (ndarray): a valid numpy frame
          rgb_mode (boolean): enable this flag to activate RGB mode _(i.e. specifies that incoming frames are of RGB format instead of default BGR)_.
  
      """
      # check if function is called in correct context
      if self.__video_source:
          raise RuntimeError(
              "[StreamGear:ERROR] :: `stream()` function cannot be used when streaming from a `-video_source` input file. Kindly refer vidgear docs!"
          )
      # None-Type frames will be skipped
      if frame is None:
          return
      # extract height, width and number of channels of frame
      height, width = frame.shape[:2]
      channels = frame.shape[-1] if frame.ndim == 3 else 1
      # assign values to class variables on first run
      if self.__initiate_stream:
          self.__inputheight = height
          self.__inputwidth = width
          self.__inputchannels = channels
          self.__sourceframerate = (
              25.0
              if not (self.__inputframerate)
              else self.__inputframerate
          )
          self.__logging and logger.debug(
              "InputFrame => Height:{} Width:{} Channels:{}".format(
                  self.__inputheight,
                  self.__inputwidth,
                  self.__inputchannels,
              )
          )
      # validate size of frame
      if height != self.__inputheight or width != self.__inputwidth:
          raise ValueError(
              "[StreamGear:ERROR] :: All frames must have same size!"
          )
      # validate number of channels
      if channels != self.__inputchannels:
          raise ValueError(
              "[StreamGear:ERROR] :: All frames must have same number of channels!"
          )
      # initiate FFmpeg process on first run
      if self.__initiate_stream:
          # launch pre-processing
          self.__PreProcess(channels=channels, rgb=rgb_mode)
          # Check status of the process
          assert self.__process is not None
  
      # write the frame to pipeline
      try:
          self.__process.stdin.write(frame.tobytes())
      except (OSError, IOError):
          # log something is wrong!
          logger.error(
              "BrokenPipeError caught, Wrong values passed to FFmpeg Pipe, Kindly Refer Docs!"
          )
          raise ValueError
  
imports: import os
  import time
  import math
  import platform
  import pathlib
  import difflib
  import logging
  import subprocess
  from tqdm import tqdm
  from fractions import Fraction
  from collections import OrderedDict
  from .helper import capPropId, dict2Args, delete_ext_safe, extract_time, is_valid_url, logger_handler, validate_audio, validate_video, check_WriteAccess, get_video_bitrate, get_valid_ffmpeg_path, logcurr_vidgear_ver
label_desc: Use image node_id 2 for calling the StreamGear obj's underlying member method code with example usage: obj.stream(frame, rgb_mode) without return types