def __init__(self, env, env_config, session_config,
        frame_interval = 10, fps =30, use_gif = False):
        '''
        Constructor for VideoWrapper. also creates the save directory if not present
        Args:
            env (Env): environment to be wrapped
            capture_interval (int): number of episodes between captures
            frame_interval (int): number of frames between each recorded frame
            fps (int): frame rate
            save_folder (str): directory to which the files are to be saved
            max_videos (int): maximum number of videos allowed in a directory
            use_gif (bool): boolean flag to use either gif or mp4
        '''

        super().__init__(env)
        self.env = env
        self.env_category = env_config.env_name.split(':')[0]

        self.max_videos = env_config.video.max_videos
        self.capture_interval = env_config.video.record_every
        self.frame_interval   = frame_interval
        self.fps = fps

        self.ext = '.gif' if use_gif else '.mp4'
        self.save_folder = env_config.video.save_folder
        if not self.save_folder:
            self.save_folder = os.path.join(session_config.folder, 'videos')
        self.save_folder = os.path.expanduser(self.save_folder)

        if not os.path.exists(self.save_folder):
            os.makedirs(self.save_folder)

        self.num_eps = 0
        self.num_steps = 0
        self.is_recording = False
        self.path_queue = Queue()
        self.num_paths = 0 #work around, qsize() not implemented on mac

        Constructor for VideoWrapper. also creates the save directory if not present
        Args:
            env (Env): environment to be wrapped
            capture_interval (int): number of episodes between captures
            frame_interval (int): number of frames between each recorded frame
            fps (int): frame rate
            save_folder (str): directory to which the files are to be saved
            max_videos (int): maximum number of videos allowed in a directory
            use_gif (bool): boolean flag to use either gif or mp4
        
surreal/env/video_env.py