PIL 即pollow 的安装命令如下: pip install pillow 其中cv2的安装是下面这条命令 pip install opencv-python 代码实现: # coding: utf-8 from PIL import ImageGrab import numpy as np import cv2 fps = 20 start = 3 # 延时录制 end = 15 # 自动结束时间 curScreen = ImageGrab.grab() # 获取屏幕对象 height, width = curScreen.size video = cv2.VideoWriter(