deepfakes/faceswap · error · ValueError

You have not supplied a valid transpose or degrees value:\nt

Error message

You have not supplied a valid transpose or degrees value:\ntranspose: {transpose}\ndegrees: {degrees}

What it means

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.

Source

Thrown at tools/effmpeg/effmpeg.py:415

                        logger.info("  %s: %s", key, val)
#        return out

    @staticmethod
    def rescale(input_=None, output=None, scale=None,  # pylint:disable=unused-argument
                exe=None, **kwargs):
        """Rescale Video"""
        _input_opts = Effmpeg._common_ffmpeg_args[:]
        _output_opts = '-y -vf scale="' + str(scale) + '"'
        _inputs = {input_.path: _input_opts}
        _outputs = {output.path: _output_opts}
        Effmpeg.__run_ffmpeg(exe=exe, inputs=_inputs, outputs=_outputs)

    @staticmethod
    def rotate(input_=None, output=None, degrees=None,  # pylint:disable=unused-argument
               transpose=None, exe=None, **kwargs):
        """Rotate Video"""
        if transpose is None and degrees is None:
            raise ValueError("You have not supplied a valid transpose or degrees value:\n"
                             f"transpose: {transpose}\ndegrees: {degrees}")

        _input_opts = Effmpeg._common_ffmpeg_args[:]
        _output_opts = "-y -c:a copy -vf "
        _bilinear = ""
        if transpose is not None:
            _output_opts += 'transpose="' + str(transpose) + '"'
        elif int(degrees) != 0:
            if int(degrees) % 90 == 0 and int(degrees) != 0:
                _bilinear = ":bilinear=0"
            _output_opts += 'rotate="' + str(degrees) + '*(PI/180)'
            _output_opts += _bilinear + '" '

        _inputs = {input_.path: _input_opts}
        _outputs = {output.path: _output_opts}
        Effmpeg.__run_ffmpeg(exe=exe, inputs=_inputs, outputs=_outputs)

    @staticmethod

View on GitHub (pinned to f530cb7508)

Solutions

  1. Add --transpose N (0=90CCW+flip, 1=90CW, 2=90CCW, 3=90CW+flip) for quarter turns.
  2. Or add --degrees D (e.g. 180, or arbitrary like 45) for a rotate filter with PI/180 math.
  3. Supply exactly one of the two; if both are given, transpose wins per the code.

Example fix

# before
python tools.py effmpeg -a rotate -i in.mp4 -o out.mp4

# after
python tools.py effmpeg -a rotate -i in.mp4 -o out.mp4 --degrees 180
Defensive patterns

Strategy: type-guard

Validate before calling

def rotate_args_valid(transpose, degrees) -> bool:
    return transpose is not None or degrees is not None

Type guard

def is_rotate_spec(transpose, degrees) -> bool:
    """Exactly one of transpose/degrees must be provided for effmpeg rotate."""
    return transpose is not None or degrees is not None

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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