我正在尝试修改给定的代码here用于屏幕流。在上面的教程中,它是用来从磁盘读取图像的,而我正在尝试截图。我收到这个错误。在
assert isinstance(data, bytes), 'applications must write bytes' AssertionError: applications must write bytes
我应该做些什么改变才能使它生效?在
这就是我目前所做的-
<br>index.html<br>
<html>
<head>
<title>Video Streaming Demonstration</title>
</head>
<body>
<h1>Video Streaming Demonstration</h1>
<img src="{{ url_for('video_feed') }}">
</body>
</html>
应用程序副本
照相机.py
完全错误: Link
响应负载必须是字节序列。在本例中,返回的图像是作为
bytes
对象的jpeg。在但是,
ImageGrab.grab()
返回的图像是一些PIL图像类,而不是字节。因此,请尝试将图像另存为JPEG格式bytes
:只为gen中的每次迭代截图:
^{pr2}$发电机功能:
相关问题 更多 >
编程相关推荐