class_docstr: Read a video
class_docstr_tok: ["Read","a","video"]
code: def __init__(self, path, transforms=None):
      super().__init__()
      if not os.path.exists(path):
          raise IOError(
              "There is not found about video path:{} ".format(path)
          )
      self.cap_video = cv2.VideoCapture(path)
      if not self.cap_video.isOpened():
          raise IOError("Video can not be oepned normally")
  
      # Get some video property
      self.fps = int(self.cap_video.get(cv2.CAP_PROP_FPS))
      self.frames = int(self.cap_video.get(cv2.CAP_PROP_FRAME_COUNT))
      self.width = int(self.cap_video.get(cv2.CAP_PROP_FRAME_WIDTH))
      self.height = int(self.cap_video.get(cv2.CAP_PROP_FRAME_HEIGHT))
  
      transforms = [] if transforms is None else transforms
      if transforms is None or isinstance(transforms, list):
          self.transforms = T.Compose(transforms)
      elif isinstance(transforms, T.Compose):
          self.transforms = transforms
      else:
          raise ValueError(
              "transforms type is error, it should be list or ppmatting,transforms.Compose"
          )
  
file_path: PaddleSeg/Matting/ppmatting/utils/video.py
imports: import os
  import warnings
  import cv2
  import paddle
  import numpy
  import ppmatting
  import ppmatting.transforms
label_desc: Use image node_id 1 to create a new VideoReader object from inherited base classes: paddle.io with example: obj = VideoReader(path, transforms)