deepfakes/faceswap · error · ValueError
The chosen action requires a video as its output, but you en
Error message
The chosen action requires a video as its output, but you entered: {self.output.path} What it means
EFFmpeg tool validation: the chosen action must produce a video file, but the supplied --output is not typed as a video (e.g. it is a directory or a non-video path). Raised in _check_inputs before any ffmpeg invocation.
Source
Thrown at tools/effmpeg/effmpeg.py:193
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.")
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"):View on GitHub (pinned to f530cb7508)
Solutions
- Pass a video file path as --output (e.g. out.mp4/out.avi) for vid-output actions.
- If you actually want frames out, pick the dir-output action instead.
- Ensure the extension matches a format ffmpeg can write.
Example fix
# before python tools.py effmpeg -a rescale -i src.mp4 -o frames/ # after python tools.py effmpeg -a rescale -i src.mp4 -o out_rescaled.mp4
Defensive patterns
Strategy: validation
Validate before calling
import os
VIDEO_EXT = {".mp4", ".avi", ".mov", ".mkv", ".webm"}
def vid_output_ok(path: str) -> bool:
return os.path.splitext(path)[-1].lower() in VIDEO_EXT and not os.path.isdir(path) Prevention
- Always name vid outputs with a real container extension.
- Never point -o at an existing directory for vid-output actions.
When it happens
Trigger: Running `python tools.py effmpeg -a rescale -i src.mp4 -o frames_dir/` or passing an output with no video container where the action's output set (_actions_have_vid_output) requires one.
Common situations: Forgetting to name the output file with a video extension; reusing an output path that exists as a directory; mixing up the frames and video action families.
Related errors
- The chosen action requires a directory as its output, but yo
- The chosen action requires a directory as its input, but you
- The chosen action requires a video as its input, but you ent
- The file chosen as the reference video is not a video, eithe
- You have not supplied a valid transpose or degrees value:\nt
AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15).
Data as JSON: /api/errors/2330ee9b2a23c607.
Report an issue: GitHub.