def use_clip_fps_by_default(func):
    """Will use ``clip.fps`` if no ``fps=...`` is provided in **kwargs**."""
    argnames = inspect.getfullargspec(func).args[1:]

    def find_fps(clip, fps):
        if fps is not None:
            return fps
        elif getattr(clip, "fps", None):
            return clip.fps
        raise AttributeError(
            "No 'fps' (frames per second) attribute specified"
            " for function %s and the clip has no 'fps' attribute. Either"
            " provide e.g. fps=24 in the arguments of the function, or define"
            " the clip's fps with `clip.fps=24`" % func.__name__
        )

    def wrapper(func, clip, *args, **kwargs):
        new_args = [
            find_fps(clip, arg) if name == "fps" else arg
            for (arg, name) in zip(args, argnames)
        ]
        new_kwargs = {
            kwarg: find_fps(clip, kwarg) if kwarg == "fps" else value
            for (kwarg, value) in kwargs.items()
        }

        return func(clip, *new_args, **new_kwargs)

    return decorator.decorate(func, wrapper)
Will use ``clip.fps`` if no ``fps=...`` is provided in **kwargs**.
moviepy/decorators.py