def mask(input_file, output_file, thresh=0.05):
    """Blackout static pixels in an ultrasound

  Examples

  sonocrop mask in.mp4 out.mp4 --thresh=0.05

  Args:
      input_file: Path to input video (must be mp4, mov, or avi)
      output_file: File path for video output
      thresh (float, optional): Defaults to 0.05
  """
    import numpy as np
    import cv2
    from pathlib import Path
    from sonocrop import vid
    import rich
    from rich.progress import Progress
    v, fps, f, height, width = vid.loadvideo(input_file)
    rich.print(f'Mask video: [underline]{input_file}[/underline]')
    rich.print(f'  Frames: {f}')
    rich.print(f'  FPS: {fps}')
    rich.print(f'  Width x height: {width} x {height}')
    rich.print(f'  Thresh: {thresh}')
    with Progress() as progress:
        task = progress.add_task('[green] Finding static video pixels...',
            total=height)
        u = np.zeros((height, width), np.uint8)
        for i in range(height):
            u[i] = np.apply_along_axis(vid.countUniquePixels, 0, v[:, (i), :])
            progress.update(task, advance=1)
    u_avg = u / f
    mask = u_avg > thresh
    y = vid.applyMask(v, mask)
    rich.print(f' Saving to file: "{output_file}"')
    vid.savevideo(output_file, y, fps)
    return 'Done'
