Commit af53ea84 authored by nextime's avatar nextime

Windows debug

parent 30e5bb3f
...@@ -93,20 +93,21 @@ class RemoteProcessFLVWriter: ...@@ -93,20 +93,21 @@ class RemoteProcessFLVWriter:
self.stderr = asyncio.create_task(self._read_to_file(stderr_log, self.proc.stderr)) self.stderr = asyncio.create_task(self._read_to_file(stderr_log, self.proc.stderr))
async def _read_to_vcam(self, stream: StreamReader): async def _read_to_vcam(self, stream: StreamReader):
import copy
with pyvirtualcam.Camera(1920, 1080, 30, fmt=PixelFormat.BGR, device=args.device, print_fps=30) as cam: with pyvirtualcam.Camera(1920, 1080, 30, fmt=PixelFormat.BGR, device=args.device, print_fps=30) as cam:
frame="" frame=""
donedone=False donedone=False
while not stream.at_eof(): while not stream.at_eof():
if not donedone: frame = await stream.readexactly(1920*1080*3)
donedone=True
frame = await stream.readexactly(1920*1080*3)
frame=np.frombuffer(frame, dtype='uint8').reshape((1080, 1920,3,))
if len(frame) >= 1920*1080*3: if len(frame) >= 1920*1080*3:
if not donedone:
print("STARTING")
donedone=True
rframe=np.fromstring(frame, dtype='uint8').reshape((1080,1920,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.send(np.frombuffer(frame, dtype='uint8').reshape((1080, 1920, 3,)))
cam.send(frame) cam.send(rframe)
#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