code: def from_file(self, video_file, offset, duration):
      if not TORCHVISION_AVAILABLE:
          raise Exception("Reading Video requires torchvision")
  
      # Load from filename
      if isinstance(video_file, str):
          video, audio, infos = torchvision.io.read_video(
              video_file,
              start_pts=offset,
              end_pts=offset + duration,
              pts_unit="sec",
          )
  
      # Load from bytes
      elif isinstance(video_file, bytes):
          # webdataset.torch_video
          with tempfile.TemporaryDirectory() as dirname:
              fname = os.path.join(dirname, f"file.mp4")
              with open(fname, "wb") as stream:
                  stream.write(video_file)
                  video, audio, infos = torchvision.io.read_video(
                      fname,
                      start_pts=offset,
                      end_pts=offset + duration,
                      pts_unit="sec",
                  )
      else:
          raise Exception("Unknown video data format")
  
      return video
  
imports: import os
  import tempfile
label_desc: Use image node_id 3 for calling the VideoFeaturizer obj's underlying member method code with example usage: obj.from_file(video_file, offset, duration) and returns: video