def _check_blackvue()

in mapillary_tools/upload.py [0:0]


def _check_blackvue(video_path: str) -> None:
    # Skip in tests only because we don't have valid sample blackvue for tests
    if os.environ.get("MAPILLARY__DISABLE_BLACKVUE_CHECK") == "YES":
        return

    points = geotag_from_blackvue.get_points_from_bv(video_path)
    if not points:
        raise exceptions.MapillaryGPXEmptyError(
            f"Empty GPS extracted from {video_path}"
        )

    stationary = video_utils.is_video_stationary(
        get_max_distance_from_start([(p.lat, p.lon) for p in points])
    )
    if stationary:
        raise exceptions.MapillaryStationaryVideoError(
            f"The video is stationary: {video_path}"
        )