{"record":{"id":"fddd77129a57f137","repo":"deepfakes/faceswap","slug":"the-chosen-action-requires-a-video-as-its-input-b","errorCode":null,"errorMessage":"The chosen action requires a video as its input, but you entered: {self.input.path}","messagePattern":"The chosen action requires a video as its input, but you entered: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/effmpeg/effmpeg.py","lineNumber":187,"sourceCode":"        \"\"\"Set :attr:`ref_vid` based on input arguments\"\"\"\n        if self.args.ref_vid is None or self.args.ref_vid == \"\":\n            self.args.ref_vid = None\n\n        self.ref_vid = DataItem(path=self.args.ref_vid)\n\n    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.\")","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/tools/effmpeg/effmpeg.py#L169-L205","documentation":"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.","triggerScenarios":"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.","commonSituations":"Confusing the frames-folder workflow with the single-video workflow; passing a file without a recognized video extension/container; typos in the input path.","solutions":["Pass an existing video file to --input for vid-input actions.","If starting from frames, first mux them into a video, then run the vid-input action.","Check `python tools.py effmpeg -h` for the action's expected input type."],"exampleFix":"# before\npython tools.py effmpeg -a rescale -i frames/ -o out.mp4\n\n# after\npython tools.py effmpeg -a mux -i frames/ -o src.mp4   # or otherwise obtain a video\npython tools.py effmpeg -a rescale -i src.mp4 -o out.mp4","handlingStrategy":"validation","validationCode":"import os\nVIDEO_EXT = {\".mp4\", \".avi\", \".mov\", \".mkv\", \".webm\"}\ndef vid_input_ok(path: str) -> bool:\n    return os.path.isfile(path) and os.path.splitext(path)[-1].lower() in VIDEO_EXT","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate -i is an existing video file for vid-input actions before launching the tool.","Keep separate wrapper commands for 'frames workflow' vs 'single video workflow'."],"tags":["faceswap","effmpeg","ffmpeg","input-validation","cli-arguments"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}