{"record":{"id":"b7014cc675959106","repo":"deepfakes/faceswap","slug":"you-have-not-supplied-a-valid-transpose-or-degrees","errorCode":null,"errorMessage":"You have not supplied a valid transpose or degrees value:\\ntranspose: {transpose}\\ndegrees: {degrees}","messagePattern":"You have not supplied a valid transpose or degrees value:\\\\ntranspose: (.+?)\\\\ndegrees: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/effmpeg/effmpeg.py","lineNumber":415,"sourceCode":"                        logger.info(\"  %s: %s\", key, val)\n#        return out\n\n    @staticmethod\n    def rescale(input_=None, output=None, scale=None,  # pylint:disable=unused-argument\n                exe=None, **kwargs):\n        \"\"\"Rescale Video\"\"\"\n        _input_opts = Effmpeg._common_ffmpeg_args[:]\n        _output_opts = '-y -vf scale=\"' + str(scale) + '\"'\n        _inputs = {input_.path: _input_opts}\n        _outputs = {output.path: _output_opts}\n        Effmpeg.__run_ffmpeg(exe=exe, inputs=_inputs, outputs=_outputs)\n\n    @staticmethod\n    def rotate(input_=None, output=None, degrees=None,  # pylint:disable=unused-argument\n               transpose=None, exe=None, **kwargs):\n        \"\"\"Rotate Video\"\"\"\n        if transpose is None and degrees is None:\n            raise ValueError(\"You have not supplied a valid transpose or degrees value:\\n\"\n                             f\"transpose: {transpose}\\ndegrees: {degrees}\")\n\n        _input_opts = Effmpeg._common_ffmpeg_args[:]\n        _output_opts = \"-y -c:a copy -vf \"\n        _bilinear = \"\"\n        if transpose is not None:\n            _output_opts += 'transpose=\"' + str(transpose) + '\"'\n        elif int(degrees) != 0:\n            if int(degrees) % 90 == 0 and int(degrees) != 0:\n                _bilinear = \":bilinear=0\"\n            _output_opts += 'rotate=\"' + str(degrees) + '*(PI/180)'\n            _output_opts += _bilinear + '\" '\n\n        _inputs = {input_.path: _input_opts}\n        _outputs = {output.path: _output_opts}\n        Effmpeg.__run_ffmpeg(exe=exe, inputs=_inputs, outputs=_outputs)\n\n    @staticmethod","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/tools/effmpeg/effmpeg.py#L397-L433","documentation":"EFFmpeg rotate action argument error: both --transpose and --degrees were None (or otherwise not supplied), so the method has no rotation instruction to build the ffmpeg -vf filter from. Raised as ValueError before ffmpeg is invoked.","triggerScenarios":"Calling `python tools.py effmpeg -a rotate -i in.mp4 -o out.mp4` with neither --transpose (0–3 quarter-turn codes) nor --degrees (e.g. 90/180) provided, or both explicitly empty from the GUI.","commonSituations":"GUI users assuming a default rotation; CLI users unaware rotate needs exactly one of the two flags; older command syntax carried over where the argument names differed.","solutions":["Add --transpose N (0=90CCW+flip, 1=90CW, 2=90CCW, 3=90CW+flip) for quarter turns.","Or add --degrees D (e.g. 180, or arbitrary like 45) for a rotate filter with PI/180 math.","Supply exactly one of the two; if both are given, transpose wins per the code."],"exampleFix":"# before\npython tools.py effmpeg -a rotate -i in.mp4 -o out.mp4\n\n# after\npython tools.py effmpeg -a rotate -i in.mp4 -o out.mp4 --degrees 180","handlingStrategy":"type-guard","validationCode":"def rotate_args_valid(transpose, degrees) -> bool:\n    return transpose is not None or degrees is not None","typeGuard":"def is_rotate_spec(transpose, degrees) -> bool:\n    \"\"\"Exactly one of transpose/degrees must be provided for effmpeg rotate.\"\"\"\n    return transpose is not None or degrees is not None","tryCatchPattern":null,"preventionTips":["Make rotate wrappers require one of --transpose/--degrees at arg-parse time.","Document the 0-3 transpose codes next to the wrapper for future reference."],"tags":["faceswap","effmpeg","ffmpeg","rotate","cli-arguments"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}