Commit 70cafcab authored by nextime's avatar nextime

Move numpy from fromstring to frombuffer

parent d162abdb
...@@ -99,7 +99,8 @@ class RemoteProcessFLVWriter: ...@@ -99,7 +99,8 @@ class RemoteProcessFLVWriter:
while not stream.at_eof(): while not stream.at_eof():
frame = await stream.readexactly(1920*1080*3) frame = await stream.readexactly(1920*1080*3)
if len(frame) >= 1920*1080*3: if len(frame) >= 1920*1080*3:
cam.send(np.fromstring(frame[:1920*1080*3], dtype='uint8').reshape((1080,1920,3,))) #cam.send(np.fromstring(frame[:1920*1080*3], dtype='uint8').reshape((1080,1920,3,)))
cam.send(np.frombuffer(frame, dtype='uint8').reshape((1080, 1920, 3,)))
cam.sleep_until_next_frame() cam.sleep_until_next_frame()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment