class_docstr: Utility class that handles all deciphering and caching of video paths for
  encoded and frame videos.
class_docstr_tok: ["Utility","class","that","handles","all","deciphering","and","caching","of","video","paths","for","encoded","and","frame","videos","."]
code: def video_from_path(
      self,
      filepath,
      decode_video=True,
      decode_audio=False,
      decoder="pyav",
      fps=30,
  ):
      try:
          is_file = g_pathmgr.isfile(filepath)
          is_dir = g_pathmgr.isdir(filepath)
      except NotImplementedError:
          # Not all PathManager handlers support is{file,dir} functions, when this is the
          # case, we default to assuming the path is a file.
          is_file = True
          is_dir = False
  
      if is_file:
          from pytorchvideo.data.encoded_video import EncodedVideo
  
          return EncodedVideo.from_path(
              filepath,
              decode_video=decode_video,
              decode_audio=decode_audio,
              decoder=decoder,
          )
      elif is_dir:
          from pytorchvideo.data.frame_video import FrameVideo
  
          assert (
              not decode_audio
          ), "decode_audio must be False when using FrameVideo"
          return FrameVideo.from_directory(
              filepath, fps, path_order_cache=self.path_order_cache
          )
      else:
          raise FileNotFoundError(f"{filepath} not found.")
  
file_path: pytorchvideo/pytorchvideo/data/video.py
imports: from abc import ABC, abstractmethod
  from typing import BinaryIO, Dict, Optional
  import torch
  from iopath.common.file_io import g_pathmgr
label_desc: Use image node_id 2 for calling the VideoPathHandler obj's underlying member method code with example usage: obj.video_from_path(filepath, decode_video, decode_audio, decoder, fps) and returns: EncodedVideo, FrameVideo