简体   繁体   中英

How to use cv2.VideoCapture() to open a live video stream from a different computer's camera remotely?

I can correctly open a live video stream from my computer's camera that I'm running my python code on. I want to continue running my code on this same computer. How can I open up a video capture from this computer that shows the camera stream of my other computer. I don't want to run the code on my other computer, but want to view the live video stream of the other computer on my current computer. I would appreciate any help on this!

vid = cv2.VideoCapture(0) #0 gets the computer i'm running on's camera. how can i remotely access my other computer's camera?
 
while(True):
     
    # Capture the video frame by frame
    ret, frame = vid.read()
 
    # Display the resulting frame
    cv2.imshow(frame)
     
    # the 'q' button is set as the quitting button
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
 
# After the loop release the cap object
vid.release()
# Destroy all the windows
cv2.destroyAllWindows()

You cannot capture another computer's camera unless you have a program on their computer that allows you to do so. For example, a malicious program that you got onto the victim's computer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM