How Can I stream video From local IP address with OpenCV

Viewed 23

this is the code I Used for capture image from local IP address Camera.

import urllib.request
import cv2 as cv
import numpy as np

frame = None
key = None

print('START')
while True:
    imgResponse = urllib.request.urlopen('http://192.168.1.1:80/capture')
    imgNp = np.array(bytearray(imgResponse.read()), dtype=np.uint8)
    frame= cv.imdecode(imgNp,-1)
    cv.imshow('Window', frame)
    key = cv.waitKey(500)
    if key == ord('q'):
        break

cv.destroyAllWindows()
print('TNE END')

how can I stream Video with This Code.

IP address is for Capturing Images : http://192.168.1.1:80/capture , IP address is for Streaming : http://192.168.1.1:81/stream

0 Answers
Related