class_docstr:     This is an auxiliary class that enables Video Streaming for ``caer`` with minimalistic latency, and at the expense
      of little to no additional computational requirements.
      
      The basic idea behind it is to tracks and save the salient feature array for the given number of frames and then uses these anchor point to cancel out all perturbations relative to it for the incoming frames in the queue. This class relies heavily on **Threaded Queue mode** for error-free & ultra-fast frame handling.
  
  Args:
      source (int, str): Source path for the video. Uses an external camera device if ``source`` is an integer.
      qsize (int): Default queue size for handling the video streams. Default: 128.
class_docstr_tok: ["This","is","an","auxiliary","class","that","enables","Video","Streaming","for","``","caer","``","with","minimalistic","latency",",","and","at","the","expense","of","little","to","no","additional","computational","requirements",".","The","basic","idea","behind","it","is","to","tracks","and","save","the","salient","feature","array","for","the","given","number","of","frames","and","then","uses","these","anchor","point","to","cancel","out","all","perturbations","relative","to","it","for","the","incoming","frames","in","the","queue",".","This","class","relies","heavily","on","*","*","Threaded","Queue","mode","*","*","for","error-free","&","ultra-fast","frame","handling",".","Args",":","source","(","int",",","str",")",":","Source","path","for","the","video",".","Uses","an","external","camera","device","if","``","source","``","is","an","integer",".","qsize","(","int",")",":","Default","queue","size","for","handling","the","video","streams",".","Default",":","128","."]
docstr: Source must either be an integer (0,1,2 etc) or a path to a video file
docstr_tok: ["Source","must","either","be","an","integer","(","0,1,2","etc",")","or","a","path","to","a","video","file"]
code: def __init__(
      self, source=0, qsize=128
  ) -> None:  # TODO: Add colorspace support
      r"""
      Source must either be an integer (0,1,2 etc) or a path to a video file
      """
      self.live_video = False
  
      if isinstance(source, int):
          self.live_video = True
          # raise ValueError("Expected a filepath. Got an integer. FileVideoStream is not for live feed. Use LiveVideoStream instead"ConnectionRefusedError())
  
      if not isinstance(source, (int, str)):
          raise ValueError(
              f"Expected either an integer or filepath. Got {type(source)}"
          )
  
      # initializing the video stream
      self._video_stream = cv.VideoCapture(source)
      self.kill_stream = False
  
      self.width = int(self._video_stream.get(FRAME_WIDTH))
      self.height = int(self._video_stream.get(FRAME_HEIGHT))
      self.res = (self.width, self.height)
  
      self.fps = math.ceil(self._video_stream.get(FPS))
      self.frames = int(self._video_stream.get(FRAME_COUNT))
  
      # initialize the queue to store frames
      self._Q: Queue = Queue(maxsize=qsize)
  
      # intialize thread
      self._thread: Optional[Thread] = None
  
file_path: caer/caer/video/stream.py
imports: from threading import Thread
  import time
  import math
  from queue import Queue
  import cv2
  import numpy
  from .constants import FPS, FRAME_COUNT, FRAME_HEIGHT, FRAME_WIDTH
  from ..annotations import Tuple, Optional
  from ..coreten import Tensor
label_desc: Use image node_id 1 to create a new Stream object  with example: obj = Stream(source, qsize)