def _get_single_screen_frame()

in core/video.py [0:0]


def _get_single_screen_frame(substream_name: str) -> ProcessorPart:
  """Get a single frame from the screen."""
  try:
    from mss import mss  # pytype: disable=import-error # pylint: disable=g-import-not-at-top
  except ImportError:
    raise ImportError("Please install mss package using 'pip install mss'")
  sct = mss.mss()
  monitor = sct.monitors[0]

  i = sct.grab(monitor)
  img = PIL.Image.frombuffer("RGB", i.size, i.rgb)
  img.format = "JPEG"

  return ProcessorPart(img, substream_name=substream_name, role="USER")