Recording live video stream from IP camera issue

Sam Berry sambez_14 at
Sun Feb 17 15:15:25 CET 2013

Hi Xav,

Iv been looking into OpenCV, i can easily stream my laptops webcam using this code.

import cv2


vc = cv2.VideoCapture(0)

if vc.isOpened(): # try to get the first frame
    rval, frame =
    rval = False

while rval:
    cv2.imshow("preview", frame)
    rval, frame =
    key = cv2.waitKey(20)
    if key == 27: # exit on ESC

However using the cv2.Videocapture(ip_address) method will not load my IP camera video feed into the new window. I can view the stream in any web browser or VLC using the IP address

Did you have this issue? Is there some lines of code i may need to add?

Any help would be appreciated!

Thanks, Sam

More information about the Python-list mailing list