1

I need to edit frames of computer webcam during a live streaming (google.meet, Skype, FaceTime..).

I tried using openvc, but I don't know how to redirect the output to replace original frames of the camera or render output to the camera path.

import cv2

video = cv2.VideoCapture(0)
if not video.isOpened():
    raise Exception('Video is not opened!')

while True:
    ret, frame = video.read() # Capture frame-by-frame
    
    # here edits like blur...
    blurred_frame = cv2.blur(frame, (10, 10))
    cv2.imshow('Video', blurred_frame) # Display the resulting frame

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# release the capture
video.release()
cv2.destroyAllWindows()

Someone can help me solving this problem?

I'm running on macOS Catalina, with Python 3.7.4

M. T.
  • 346
  • 5
  • 18
  • Your question is lacking details. How do you want to modify it exactly? – Mark Setchell Oct 02 '20 at 18:49
  • @MarkSetchell I edited the code, maybe you understand better. I need to redirect output of cv2 to webcam. Here there is an example https://stackoverflow.com/questions/21446292/using-opencv-output-as-webcam but only works on Linux... – M. T. Oct 02 '20 at 18:57
  • You want to send images to a camera? Normally cameras only transmit images. – Mark Setchell Oct 02 '20 at 18:59
  • I write it to you in the easiest way to understand. I need to add a filter to the images I transmit with the webcam from the computer to a live streaming system. – M. T. Oct 02 '20 at 19:02
  • @M.T. "Only works for Linux"? The second answer there seems to work for both. – user202729 Oct 03 '20 at 08:32
  • no It doesn't work properly – M. T. Oct 04 '20 at 08:22

0 Answers0