I'm trying to get a video feed through camera of my android phone using IP webcam and opencv.I'm using python 3.5(anaconda distribution) with opencv 3.1.0 Here is the code:
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
cap.open('http://192.168.1.4:8080/video')
while True:
ret, frame = cap.read()
cv2.imshow('RGB output', frame)
if cv2.waitKey(0):
break
cap.release()
cv2.destroyAllWindows()
Problem is that when I run the script, I can only see the first frame rather than the constant video feed. I've searched alot but couldn't find a solution. Help!