def start(self):
printD("streamserver: start")
self.running = True
while self.running:
frame = self.videostream.read()
serialized_data = msgpack.packb(frame, default=msgpack_numpy.encode)
# Write the length of the capture to the stream and flush to ensure it actually gets sent
data_len = len(serialized_data)
printD("data_len: %d" % data_len)
self.connection.write(struct.pack('<L', data_len))
self.connection.flush()
# Send the image data over the wire
self.connection.write(serialized_data)
self.connection.flush()
printD("send.")
sleep(0.001)
评论列表
文章目录