          while self.frame_order:
              if self.frame_order[0] not in self.cache:
                  logger.trace("Next frame not ready. Continuing")
                  break
              save_no = self.frame_order.pop(0)
              save_image = self.cache.pop(save_no)
              logger.trace("Rendering from cache. Frame no: %s", save_no)
              self.writer.append_data(save_image[:, :, ::-1])
          logger.trace("Current cache size: %s", len(self.cache))
  
 
</s> remove             self.writer.append_data(save_image[:, :, ::-1])
 </s> add             self._writer.append_data(save_image[:, :, ::-1]) </s> remove         self.output_dimensions = "{}:{}".format(
            int(ceil(frame_dims[1] / 16) * 16),
            int(ceil(frame_dims[0] / 16) * 16))
        logger.debug("Set dimensions: %s", self.output_dimensions)

    def save_from_cache(self):
        """ Save all the frames that are ready to be output from cache """
        while self.frame_order:
            if self.frame_order[0] not in self.cache:
 </s> add         self._output_dimensions = (f"{int(ceil(frame_dims[1] / 16) * 16)}:"
                                   f"{int(ceil(frame_dims[0] / 16) * 16)}")
        logger.debug("Set dimensions: %s", self._output_dimensions)

    def _save_from_cache(self) -> None:
        """ Writes any consecutive frames to the video container that are ready to be output
        from the cache. """
        while self._frame_order:
            if self._frame_order[0] not in self.cache: </s> remove     def close(self):
 </s> add     def close(self) -> None: </s> remove     def cache_frame(self, filename, image):
        """ Add the incoming frame to the cache """
 </s> add     def cache_frame(self, filename, image) -> None:
        """ Add the incoming converted frame to the cache ready for writing out.

        Used for ffmpeg and gif writers to ensure that the frames are written out in the correct
        order.

        Parameters
        ----------
        filename: str
            The filename of the incoming frame, where the frame index can be extracted from
        image: class:`numpy.ndarray`
            The converted frame corresponding to the given filename
        """ </s> remove     def write(self, filename, image):
        """ Override for specific frame writing method """
 </s> add     def write(self, filename: str, image) -> None:
        """ Override for specific frame writing method.

        Parameters
        ----------
        filename: str
            The incoming frame filename.
        image: :class:`numpy.ndarray`
            The converted image to be written
        """
            save_no = self._frame_order.pop(0)
          while self.frame_order:
              if self.frame_order[0] not in self.cache:
                  logger.trace("Next frame not ready. Continuing")
                  break
            save_no = self._frame_order.pop(0)
              save_image = self.cache.pop(save_no)
              logger.trace("Rendering from cache. Frame no: %s", save_no)
              self.writer.append_data(save_image[:, :, ::-1])
          logger.trace("Current cache size: %s", len(self.cache))
  
keep keep keep keep replace keep keep keep keep keep
 ffmpeg writer: Create new filename if output pre-exists 
plugins/convert/writer/ffmpeg.py