def _step(self, action):
        '''
        Overwrites _step function. In addition to taking an action,
        if the video is recording and its time to capture a frame, the
        frame is rendered using 'rgb_array' mode and is put into the video_queue.
        If video capture is over, stop_recording is called.
        '''
        state, step_reward, terminal, info = self.env.step(action)
        self.num_steps += 1
        if self.is_recording:
            # For dm_control videos, the video will be transposed when we save to disk
            # We correct for that here
            ob = self.env.render()
            if self.env_category == 'dm_control':
                ob = ob.transpose(1, 0, 2)
            else: # mujocomanip
                ob = np.rot90(ob, 2)
            self.video_queue.put(ob)

        return state, step_reward, terminal, info

        Overwrites _step function. In addition to taking an action,
        if the video is recording and its time to capture a frame, the
        frame is rendered using 'rgb_array' mode and is put into the video_queue.
        If video capture is over, stop_recording is called.
        
surreal/env/video_env.py