我想从服务器截图并通过套接字发送到客户端,
在客户端接收并显示(作为视频)
我试试这个:
from PIL import ImageGrab
import base64
from io import StringIO,BytesIO
def sendVideo(MySocket):
print("in sendVideo")
buffer = BytesIO()
while True:
im = ImageGrab.grab()
im.save(buffer, format='PNG')
b64_str = base64.b64encode(buffer.getvalue())
MySocket.send(b64_str)
但不能正常工作(这意味着它只发送一个图像(第一帧),并且只显示相同的图像)
我使用pythonv3.7
谢谢你
目前没有回答
相关问题 更多 >
编程相关推荐