Skip to content

Instantly share code, notes, and snippets.

@nkymut
Created June 8, 2018 04:50
Show Gist options
  • Save nkymut/2517625de53c6cc534bd4a2bab83709a to your computer and use it in GitHub Desktop.
Save nkymut/2517625de53c6cc534bd4a2bab83709a to your computer and use it in GitHub Desktop.
Retrieving mjpeg video stream from an IP Camera with opencv python
import cv2
cap = cv2.VideoCapture('http://admin:password@127.0.0.1/video/mjpg.cgi')
while True:
ret, frame = cap.read()
print(frame.shape)
cv2.imshow('Video', frame)
if cv2.waitKey(1) == 27:
exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment