{"record":{"id":"2330ee9b2a23c607","repo":"deepfakes/faceswap","slug":"the-chosen-action-requires-a-video-as-its-output","errorCode":null,"errorMessage":"The chosen action requires a video as its output, but you entered: {self.output.path}","messagePattern":"The chosen action requires a video as its output, but you entered: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/effmpeg/effmpeg.py","lineNumber":193,"sourceCode":"    def _check_inputs(self) -> None:\n        \"\"\"Validate provided arguments are valid\n\n        Raises\n        ------\n        ValueError\n            If provided arguments are not valid\n        \"\"\"\n        if self.args.action in self._actions_have_dir_input and not self.input.is_type(\"dir\"):\n            raise ValueError(\"The chosen action requires a directory as its input, but you \"\n                             f\"entered: {self.input.path}\")\n        if self.args.action in self._actions_have_vid_input and not self.input.is_type(\"vid\"):\n            raise ValueError(\"The chosen action requires a video as its input, but you entered: \"\n                             f\"{self.input.path}\")\n        if self.args.action in self._actions_have_dir_output and not self.output.is_type(\"dir\"):\n            raise ValueError(\"The chosen action requires a directory as its output, but you \"\n                             f\"entered: {self.output.path}\")\n        if self.args.action in self._actions_have_vid_output and not self.output.is_type(\"vid\"):\n            raise ValueError(\"The chosen action requires a video as its output, but you entered: \"\n                             f\"{self.output.path}\")\n\n        # Check that ref_vid is a video when it needs to be\n        if self.args.action in self._actions_req_ref_video:\n            if self.ref_vid.is_type(\"none\"):\n                raise ValueError(\"The file chosen as the reference video is not a video, either \"\n                                 f\"leave the field blank or type 'None': {self.ref_vid.path}\")\n        elif self.args.action in self._actions_can_use_ref_video:\n            if self.ref_vid.is_type(\"none\"):\n                logger.warning(\"Warning: no reference video was supplied, even though \"\n                               \"one may be used with the chosen action. If this is \"\n                               \"intentional then ignore this warning.\")\n\n    def _set_times(self) -> None:\n        \"\"\"Set start, end and duration attributes\"\"\"\n        self.start = self.parse_time(self.args.start)\n        self.end = self.parse_time(self.args.end)\n        if not self.__check_equals_time(self.args.end, \"00:00:00\"):","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/tools/effmpeg/effmpeg.py#L175-L211","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\npython tools.py effmpeg -a rescale -i src.mp4 -o frames/\n\n# after\npython tools.py effmpeg -a rescale -i src.mp4 -o out_rescaled.mp4","handlingStrategy":"validation","validationCode":"import os\nVIDEO_EXT = {\".mp4\", \".avi\", \".mov\", \".mkv\", \".webm\"}\ndef vid_output_ok(path: str) -> bool:\n    return os.path.splitext(path)[-1].lower() in VIDEO_EXT and not os.path.isdir(path)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always name vid outputs with a real container extension.","Never point -o at an existing directory for vid-output actions."],"tags":["faceswap","effmpeg","ffmpeg","output-validation","cli-arguments"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}