我的带有websockets的python screenshare程序非常慢,看起来每秒只有1到2帧
客户端使用mss拍摄屏幕截图
sct = mss.mss()
moniter = sct.monitors[1]
sct.compression_level = 7
im = sct.grab(moniter)
raw_bytes = mss.tools.to_png(im.rgb, im.size)
return base64.encodebytes(raw_bytes) # the bytes are directly sent through the websocket
服务器端接收图像
img_bytes = base64.decodebytes(await self.ws.recv()) # receive bytes and decode base64
img = Image.open(io.BytesIO(img_bytes))
如何使屏幕共享更快? 谢谢
目前没有回答
相关问题 更多 >
编程相关推荐