def __init__(self, logdir):
    self.PLUGIN_LOGDIR = logdir + '/plugins/' + PLUGIN_NAME

    self.is_recording = False
    self.video_writer = video_writing.VideoWriter(
        self.PLUGIN_LOGDIR,
        outputs=[
            video_writing.FFmpegVideoOutput,
            video_writing.PNGVideoOutput])

    self.frame_placeholder = tf.placeholder(tf.uint8, [None, None, None])
    self.summary_op = tf.summary.tensor_summary(TAG_NAME,
                                                self.frame_placeholder)

    self.last_image_shape = []
    self.last_update_time = time.time()
    self.config_last_modified_time = -1
    self.previous_config = dict(DEFAULT_CONFIG)

    if not tf.gfile.Exists(self.PLUGIN_LOGDIR + '/config.pkl'):
      tf.gfile.MakeDirs(self.PLUGIN_LOGDIR)
      write_pickle(DEFAULT_CONFIG, '{}/{}'.format(self.PLUGIN_LOGDIR,
                                                  CONFIG_FILENAME))

    self.visualizer = Visualizer(self.PLUGIN_LOGDIR)