I have been using this logic all the while. I was using standard webcam with cv2 (version 2.4.13)
cam = cv2.VideoCapture(0)
while(True):
ret,img = cam.read()
But i want to use IP camera in place of webcam. give a lead how to get around with IP camera in openCV+Python