class_docstr:     This is an auxiliary class that enables Video Streaming using the GPU 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. If ``source=0``, the default camera device is used. For 
          multiple external camera devices, use incremented values. For eg: ``source=1`` represents the second camera device on your system.
      qsize (int): Default queue size for handling the video streams. Default: 128.
class_docstr_tok: ["This","is","an","auxiliary","class","that","enables","Video","Streaming","using","the","GPU","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",".","If","``","source=0","``",",","the","default","camera","device","is","used",".","For","multiple","external","camera","devices",",","use","incremented","values",".","For","eg",":","``","source=1","``","represents","the","second","camera","device","on","your","system",".","qsize","(","int",")",":","Default","queue","size","for","handling","the","video","streams",".","Default",":","128","."]
docstr: Source must be a path to a video file
  Utilizes your system's GPU to process the stream
docstr_tok: ["Source","must","be","a","path","to","a","video","file","Utilizes","your","system","'s","GPU","to","process","the","stream"]
code: def __init__(self, source, qsize=128):
      """
      Source must be a path to a video file
      Utilizes your system's GPU to process the stream
      """
  
      if not isinstance(source, str):
          raise ValueError(
              f"Expected either a filepath. Got {type(source)}. Consider using VideoStream which supports both live video as well as pre-existing videos"
          )
  
      # initialize the file video stream along with the boolean
      # used to indicate if the thread should be stopped or not
      self.stream = cv.VideoCapture(source)
      self.kill_stream = False
      self.count = 0
      self.live_video: bool = False
  
      # initialize the queue to store frames
      self.Q: Queue = Queue(maxsize=qsize)
  
      self.width = int(self.stream.get(cv.CAP_PROP_FRAME_WIDTH))
      self.height = int(self.stream.get(cv.CAP_PROP_FRAME_HEIGHT))
      self.res = (self.width, self.height)
  
      self.fps = math.ceil(self.stream.get(FPS))
      self.frames = int(self.stream.get(FRAME_COUNT))
  
      self._thread: Optional[Thread] = None
  
      # since we use UMat to store the images to
      # we need to initialize them beforehand
      self.qframes = [0] * qsize
      for ii in range(qsize):
          self.qframes[ii] = cv.UMat(
              self.height, self.width, cv.CV_8UC3
          )
  
file_path: caer/caer/video/gpufilestream.py
imports: from threading import Thread
  import time
  import math
  from queue import Queue
  import cv2
  from ..annotations import Optional
  from .constants import FRAME_COUNT, FPS
label_desc: Use image node_id 1 to create a new GPUFileStream object  with example: obj = GPUFileStream(source, qsize)