我是一名初学Pythoon程序员,致力于基于本教程设置Flask视频服务器.我遇到问题的代码用于初始化计算机网络摄像头并输出帧:
class Camera(object):
thread = None # background thread that reads frames from camera
frame = None # current frame is stored here by background thread
last_access = 0 # time of last client access to the camera
start_time = 0 # time at which the camera is started
def __init__(self):
"""Start the background camera thread if it isn't running yet."""
...
def get_frame(self):
"""Return the current camera frame."""
...
@staticmethod
def frames():
""""Generator that returns frames from …Run Code Online (Sandbox Code Playgroud)