(self, backend=False)
| 422 | self.recording_sp = subprocess.Popen(args, stdin=subprocess.PIPE) |
| 423 | |
| 424 | def enable_virtualcam(self, backend=False): |
| 425 | #Check if capture contains any cv2 stream or is it an empty list |
| 426 | if self.media_capture: |
| 427 | if isinstance(self.current_frame, numpy.ndarray): |
| 428 | frame_height, frame_width, _ = self.current_frame.shape |
| 429 | else: |
| 430 | frame_height = int(self.media_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)) |
| 431 | frame_width = int(self.media_capture.get(cv2.CAP_PROP_FRAME_WIDTH)) |
| 432 | self.disable_virtualcam() |
| 433 | try: |
| 434 | backend = backend or self.main_window.control['VirtCamBackendSelection'] |
| 435 | # self.virtcam = pyvirtualcam.Camera(width=vid_width, height=vid_height, fps=int(self.fps), backend='unitycapture', device='Unity Video Capture') |
| 436 | self.virtcam = pyvirtualcam.Camera(width=frame_width, height=frame_height, fps=int(self.fps), backend=backend, fmt=pyvirtualcam.PixelFormat.BGR) |
| 437 | |
| 438 | except Exception as e: |
| 439 | print(e) |
| 440 | |
| 441 | def disable_virtualcam(self): |
| 442 | if self.virtcam: |
no test coverage detected