deepfakes/faceswap · error · ValueError

The file chosen as the reference video is not a video, eithe

Error message

The file chosen as the reference video is not a video, either leave the field blank or type 'None': {self.ref_vid.path}

What it means

EFFmpeg tool validation: the chosen action requires a reference video (--ref-video), but the given path is typed 'none' (missing, or literally 'None'), so the action cannot proceed. The message tells you to blank the field or type 'None' only when no reference is intended — here one is mandatory.

Source

Thrown at tools/effmpeg/effmpeg.py:199

            If provided arguments are not valid
        """
        if self.args.action in self._actions_have_dir_input and not self.input.is_type("dir"):
            raise ValueError("The chosen action requires a directory as its input, but you "
                             f"entered: {self.input.path}")
        if self.args.action in self._actions_have_vid_input and not self.input.is_type("vid"):
            raise ValueError("The chosen action requires a video as its input, but you entered: "
                             f"{self.input.path}")
        if self.args.action in self._actions_have_dir_output and not self.output.is_type("dir"):
            raise ValueError("The chosen action requires a directory as its output, but you "
                             f"entered: {self.output.path}")
        if self.args.action in self._actions_have_vid_output and not self.output.is_type("vid"):
            raise ValueError("The chosen action requires a video as its output, but you entered: "
                             f"{self.output.path}")

        # Check that ref_vid is a video when it needs to be
        if self.args.action in self._actions_req_ref_video:
            if self.ref_vid.is_type("none"):
                raise ValueError("The file chosen as the reference video is not a video, either "
                                 f"leave the field blank or type 'None': {self.ref_vid.path}")
        elif self.args.action in self._actions_can_use_ref_video:
            if self.ref_vid.is_type("none"):
                logger.warning("Warning: no reference video was supplied, even though "
                               "one may be used with the chosen action. If this is "
                               "intentional then ignore this warning.")

    def _set_times(self) -> None:
        """Set start, end and duration attributes"""
        self.start = self.parse_time(self.args.start)
        self.end = self.parse_time(self.args.end)
        if not self.__check_equals_time(self.args.end, "00:00:00"):
            self.duration = self.__get_duration(self.start, self.end)
        else:
            self.duration = self.parse_time(str(self.args.duration))

    def _set_fps(self) -> None:
        """Set :attr:`arguments.fps` based on input arguments"""

View on GitHub (pinned to f530cb7508)

Solutions

  1. Supply a valid reference video: `--ref-video /path/to/ref.mp4`.
  2. Verify the reference file exists and is a real video container.
  3. If you intended to run without a reference, choose an action that does not require one (see effmpeg -h).

Example fix

# before
python tools.py effmpeg -a mux-mp4 -i frames/ -o out.mp4   # ref-video omitted

# after
python tools.py effmpeg -a mux-mp4 -i frames/ -o out.mp4 --ref-video original.mp4
Defensive patterns

Strategy: validation

Validate before calling

import os

def ref_video_ok(path: str | None) -> bool:
    return bool(path) and path != "None" and os.path.isfile(path)

Prevention

When it happens

Trigger: Running an action in _actions_req_ref_video (e.g. mux-h264/h265 style jobs that need stream parameters from the reference) with --ref-video omitted, empty, misspelled so it resolves to none, or set to the literal string 'None'.

Common situations: GUI users leaving the reference field blank; CLI users omitting the flag; path typos or a non-video reference file making DataItem classify it as 'none'.

Related errors


AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15). Data as JSON: /api/errors/bd7447d5455daa10. Report an issue: GitHub.