deepfakes/faceswap · error · ValueError

The chosen action requires a video as its input, but you ent

Error message

The chosen action requires a video as its input, but you entered: {self.input.path}

What it means

EFFmpeg tool validation: the chosen action requires a video file as input (e.g. rescale, rotate a single video), but the supplied --input is not classified as a video by DataItem.is_type('vid'). Fails fast before ffmpeg is spawned.

Source

Thrown at tools/effmpeg/effmpeg.py:187

        """Set :attr:`ref_vid` based on input arguments"""
        if self.args.ref_vid is None or self.args.ref_vid == "":
            self.args.ref_vid = None

        self.ref_vid = DataItem(path=self.args.ref_vid)

    def _check_inputs(self) -> None:
        """Validate provided arguments are valid

        Raises
        ------
        ValueError
            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.")

View on GitHub (pinned to f530cb7508)

Solutions

  1. Pass an existing video file to --input for vid-input actions.
  2. If starting from frames, first mux them into a video, then run the vid-input action.
  3. Check `python tools.py effmpeg -h` for the action's expected input type.

Example fix

# before
python tools.py effmpeg -a rescale -i frames/ -o out.mp4

# after
python tools.py effmpeg -a mux -i frames/ -o src.mp4   # or otherwise obtain a video
python tools.py effmpeg -a rescale -i src.mp4 -o out.mp4
Defensive patterns

Strategy: validation

Validate before calling

import os
VIDEO_EXT = {".mp4", ".avi", ".mov", ".mkv", ".webm"}
def vid_input_ok(path: str) -> bool:
    return os.path.isfile(path) and os.path.splitext(path)[-1].lower() in VIDEO_EXT

Prevention

When it happens

Trigger: Running a vid-input action like `-a rescale -i frames_dir/` (a directory) or pointing -i at a missing/non-video path so the type check fails.

Common situations: Confusing the frames-folder workflow with the single-video workflow; passing a file without a recognized video extension/container; typos in the input path.

Related errors


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