from pathlib import Path


def get_output_filepath(filepath):
    """Returns a new output filepath based on a given filepath.
    Given filepath: /Users/max/Desktop/video.mp4
    Returned filepath: /Users/max/Desktop/video_blurred.mp4

    Args:
        filepath (str): Path to an existing file

    Returns:
        str: Path to a not yet existing file
    """
    path = Path(filepath)

    suffix = path.suffix
    filename = path.stem

    counter = 0

    while True:
        if counter == 0:
            new_name = filename + '_blurred' + suffix
        else:
            new_name = filename + '_blurred_' + str(counter) + suffix
        new_path = path.with_name(new_name)
        if not new_path.exists():
            output_filepath = str(new_path)
            break
        counter += 1

    return output_filepath