import json


def get_fps_from_file(filepath: str) -> float:
    """
    Get fps from JSON file generated by FFprobe.
    """
    with open(filepath) as jsonf:
        js = json.load(jsonf)
    fps = 30
    for st in js["streams"]:
        if st["codec_type"] == "video":
            fps = float(st["nb_frames"]) / float(st["duration"])
    return fps