class_docstr: A class for exporting videos.
docstr: Generate the video from the written frames.
  
  Args:
      quiet: If `True`, suppresses logging messages.
  
  Returns:
      video_path: The path to the generated video if any frames were added.
          Otherwise returns an empty string.
docstr_tok: ["Generate","the","video","from","the","written","frames",".","Args",":","quiet",":","If","`","True","`",",","suppresses","logging","messages",".","Returns",":","video_path",":","The","path","to","the","generated","video","if","any","frames","were","added",".","Otherwise","returns","an","empty","string","."]
code: def get_video(self, quiet: bool = True) -> str:
      """
      Generate the video from the written frames.
  
      Args:
          quiet: If `True`, suppresses logging messages.
  
      Returns:
          video_path: The path to the generated video if any frames were added.
              Otherwise returns an empty string.
      """
      if self.frame_num == 0:
          return ""
  
      # pyre-fixme[6]: For 1st argument expected `Union[PathLike[str], str]` but
      #  got `Optional[str]`.
      regexp = os.path.join(self.cache_dir, self.regexp)
  
      if shutil.which(self.ffmpeg_bin) is None:
          raise ValueError(
              f"Cannot find ffmpeg as `{self.ffmpeg_bin}`. "
              + "Please set FFMPEG in the environment or ffmpeg_bin on this class."
          )
  
      if self.output_format == "visdom":  # works for ppt too
          args = [
              self.ffmpeg_bin,
              "-r",
              str(self.fps),
              "-i",
              regexp,
              "-vcodec",
              "h264",
              "-f",
              "mp4",
              "-y",
              "-crf",
              "18",
              "-b",
              "2000k",
              "-pix_fmt",
              "yuv420p",
              self.out_path,
          ]
          if quiet:
              subprocess.check_call(
                  args,
                  stdout=subprocess.DEVNULL,
                  stderr=subprocess.DEVNULL,
              )
          else:
              subprocess.check_call(args)
      else:
          raise ValueError(
              "no such output type %s" % str(self.output_format)
          )
  
      return self.out_path
  
file_path: pytorch3d/pytorch3d/implicitron/tools/video_writer.py
imports: import os
  import shutil
  import subprocess
  import tempfile
  import warnings
  from typing import Optional, Tuple, Union
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from PIL import Image
label_desc: Use image node_id 3 for calling the VideoWriter obj's underlying member method code with example usage: obj.get_video(quiet) and returns: self, str