code: def _load_video_from_path_decord(
      self,
      video_path,
      height=None,
      width=None,
      start_time=None,
      end_time=None,
      fps=-1,
  ):
      try:
          if not height or not width:
              vr = VideoReader(video_path)
          else:
              vr = VideoReader(video_path, width=width, height=height)
  
          vlen = len(vr)
  
          if start_time or end_time:
              assert (
                  fps > 0
              ), "must provide video fps if specifying start and end time."
  
              start_idx = min(int(start_time * fps), vlen)
              end_idx = min(int(end_time * fps), vlen)
          else:
              start_idx, end_idx = 0, vlen
  
          if self.frm_sampling_strategy == "uniform":
              frame_indices = np.arange(
                  start_idx, end_idx, vlen / self.num_frm, dtype=int
              )
          elif self.frm_sampling_strategy == "rand":
              frame_indices = sorted(
                  random.sample(range(vlen), self.num_frm)
              )
          elif self.frm_sampling_strategy == "headtail":
              frame_indices_head = sorted(
                  random.sample(range(vlen // 2), self.num_frm // 2)
              )
              frame_indices_tail = sorted(
                  random.sample(
                      range(vlen // 2, vlen), self.num_frm // 2
                  )
              )
              frame_indices = frame_indices_head + frame_indices_tail
          else:
              raise NotImplementedError(
                  "Invalid sampling strategy {} ".format(
                      self.frm_sampling_strategy
                  )
              )
  
          raw_sample_frms = vr.get_batch(frame_indices)
      except Exception as e:
          return None
  
      raw_sample_frms = raw_sample_frms.permute(0, 3, 1, 2)
  
      return raw_sample_frms
  
imports: from torch.utils.data import Dataset
  from torchvision.datasets.utils import download_url
  from PIL import Image
  import torch
  import numpy
  import random
  import decord
  from decord import VideoReader
  import json
  import os
  from data.utils import pre_caption
label_desc: Use image node_id 4 for calling the VideoDataset obj's underlying member method code with example usage: obj._load_video_from_path_decord(video_path, height, width, start_time, end_time, fps) and returns: raw_sample_frms, None