          out_filename = os.path.join(self.output_folder, out_filename)
          logger.trace("in filename: '%s', out filename: '%s'", filename, out_filename)
          return out_filename
  
      def cache_frame(self, filename, image):
          """ Add the incoming frame to the cache """
          frame_no = int(re.search(self.re_search, filename).group())
          self.cache[frame_no] = image
          logger.trace("Added to cache. Frame no: %s", frame_no)
          logger.trace("Current cache: %s", sorted(self.cache.keys()))
  
 
</s> remove         out_filename = "{}.{}".format(filename, self.config["format"])
 </s> add         out_filename = f"{filename}.{self.config['format']}" </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
        """ </s> remove     def output_filename(self, filename):
        """ Return the output filename with the correct folder and extension
            NB: The plugin must have a config item 'format' that contains the
                file extension to use this method """
 </s> add     def output_filename(self, filename: str) -> str:
        """ Obtain the full path for the output file, including the correct extension, for the
        given input filename.

        NB: The plugin must have a config item 'format' that contains the file extension to use
        this method.

        Parameters
        ----------
        filename: str
            The input frame filename to generate the output file name for

        Returns
        -------
        str
            The full path for the output converted frame to be saved to.
        """ </s> remove     def write(self, filename, image):
        """ Frames come from the pool in arbitrary order, so cache frames
            for writing out in correct order """
 </s> add     def write(self, filename: str, image) -> None:
        """ Frames come from the pool in arbitrary order, so frames are cached for writing out
        in the correct order.

        Parameters
        ----------
        filename: str
            The incoming frame filename.
        image: :class:`numpy.ndarray`
            The converted image to be written
        """ </s> remove             self.writer.append_data(save_image[:, :, ::-1])
 </s> add             self._writer.append_data(save_image[:, :, ::-1])
    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
        """
          out_filename = os.path.join(self.output_folder, out_filename)
          logger.trace("in filename: '%s', out filename: '%s'", filename, out_filename)
          return out_filename
  
    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
        """
    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
        """
          frame_no = int(re.search(self.re_search, filename).group())
          self.cache[frame_no] = image
          logger.trace("Added to cache. Frame no: %s", frame_no)
          logger.trace("Current cache: %s", sorted(self.cache.keys()))
  
keep keep keep keep replace replace keep keep keep keep keep
 ffmpeg writer: Create new filename if output pre-exists 
plugins/convert/writer/_base.py