class_docstr: Code to visualize an agent's behaviour.
class_docstr_tok: ["Code","to","visualize","an","agent","'s","behaviour","."]
docstr: Generates a video, requires 'png' be in file_types.
  
  Note that this will issue a `subprocess.call` to `ffmpeg`, so only use this
  functionality with trusted paths.
  
  Args:
    video_file: str, name of video file to generate.
docstr_tok: ["Generates","a","video",",","requires","'png","'","be","in","file_types",".","Note","that","this","will","issue","a","`","subprocess.call","`","to","`","ffmpeg","`",",","so","only","use","this","functionality","with","trusted","paths",".","Args",":","video_file",":","str",",","name","of","video","file","to","generate","."]
code: def generate_video(self, video_file="video.mp4"):
      """Generates a video, requires 'png' be in file_types.
  
      Note that this will issue a `subprocess.call` to `ffmpeg`, so only use this
      functionality with trusted paths.
  
      Args:
        video_file: str, name of video file to generate.
      """
      if "png" not in self.file_types:
          return
      os.chdir(self.record_path)
      file_regex = self.filename_format.replace("{:", "%").replace(
          "}", ""
      )
      file_regex += ".png"
      subprocess.call(
          [
              "ffmpeg",
              "-r",
              "30",
              "-f",
              "image2",
              "-s",
              "1920x1080",
              "-i",
              file_regex,
              "-vcodec",
              "libx264",
              "-crf",
              "25",
              "-pix_fmt",
              "yuv420p",
              video_file,
          ]
      )
  
file_path: dopamine/dopamine/utils/agent_visualizer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import subprocess
  import gin
  import numpy
  from PIL import Image
  import pygame
label_desc: Use image node_id 4 for calling the AgentVisualizer obj's underlying member method code with example usage: obj.generate_video(video_file) without return types