class_docstr: Video class with similar usage to a list object.
  
  This video warpper class provides convenient apis to access frames.
  There exists an issue of OpenCV's VideoCapture class that jumping to a
  certain frame may be inaccurate. It is fixed in this class by checking
  the position after jumping each time.
  Cache is used when decoding videos. So if the same frame is visited for
  the second time, there is no need to decode again if it is stored in the
  cache.
  
  :Example:
  
  >>> import annotator.uniformer.mmcv as mmcv
  >>> v = mmcv.VideoReader('sample.mp4')
  >>> len(v)  # get the total frame number with `len()`
  120
  >>> for img in v:  # v is iterable
  >>>     mmcv.imshow(img)
  >>> v[5]  # get the 6th frame
class_docstr_tok: ["Video","class","with","similar","usage","to","a","list","object",".","This","video","warpper","class","provides","convenient","apis","to","access","frames",".","There","exists","an","issue","of","OpenCV","'s","VideoCapture","class","that","jumping","to","a","certain","frame","may","be","inaccurate",".","It","is","fixed","in","this","class","by","checking","the","position","after","jumping","each","time",".","Cache","is","used","when","decoding","videos",".","So","if","the","same","frame","is","visited","for","the","second","time",",","there","is","no","need","to","decode","again","if","it","is","stored","in","the","cache",".",":","Example",":",">",">",">","import","annotator.uniformer.mmcv","as","mmcv",">",">",">","v","=","mmcv.VideoReader","(","'sample.mp4","'",")",">",">",">","len","(","v",")","#","get","the","total","frame","number","with","`","len","(",")","`","120",">",">",">","for","img","in","v",":","#","v","is","iterable",">",">",">","mmcv.imshow","(","img",")",">",">",">","v","[","5","]","#","get","the","6th","frame"]
code: def __next__(self):
      img = self.read()
      if img is not None:
          return img
      else:
          raise StopIteration
  
imports: import os.path
  from collections import OrderedDict
  import cv2
  from cv2 import CAP_PROP_FOURCC, CAP_PROP_FPS, CAP_PROP_FRAME_COUNT, CAP_PROP_FRAME_HEIGHT, CAP_PROP_FRAME_WIDTH, CAP_PROP_POS_FRAMES, VideoWriter_fourcc
  from annotator.uniformer.mmcv.utils import check_file_exist, mkdir_or_exist, scandir, track_progress
label_desc: Use image node_id 20 for calling the VideoReader obj's underlying member method code with example usage: obj.__next__() and returns: img