code: async def get_image(
          self,
          input_source: str,
          output_format: str = IMAGE_JPEG,
          extra_cmd: Optional[str] = None,
          timeout: int = 15,
      ) -> Optional[bytes]:
          
          command = ["-an", "-frames:v", "1", "-c:v", output_format]
  
          # open input for capture 1 frame
          is_open = await self.open(
              cmd=command,
              input_source=input_source,
              output="-f image2pipe -",
              extra_cmd=extra_cmd,
          )
  
          # error after open?
          if not is_open:
              _LOGGER.warning("Error starting FFmpeg.")
              return None
  
          # read image
          try:
              proc_func = functools.partial(self._proc.communicate, timeout=timeout)
              image, _ = await self._loop.run_in_executor(None, proc_func)
              return image
  
          except (subprocess.TimeoutExpired, ValueError):
              _LOGGER.warning("Timeout reading image.")
              self.kill()
              return None
docs: Open FFmpeg process as capture 1 frame.