Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

like Spas Hristov said, cv.CaptureFromCAM(int id) is used for (local) cameras, not for streams/urls.

try:

   cap = cv2.VideoCapture("http://@192.168.1.6:86/")
   while cap.isOpened():
       _,frame = cap.read()
       cv2.imshow("stream",frame)
       c = cv2.waitKey(1)
       if c == 27:
           break

like Spas Hristov said, cv.CaptureFromCAM(int id) is used for (local) cameras, not for streams/urls.

try:

   import cv2

   cap = cv2.VideoCapture("http://@192.168.1.6:86/")
   while cap.isOpened():
       _,frame = cap.read()
       cv2.imshow("stream",frame)
       c = cv2.waitKey(1)
       if c == 27:
           break

like Spas Hristov said, cv.CaptureFromCAM(int id) is used for (local) cameras, not for streams/urls.

try:

   import cv2
   import numpy

   cap = cv2.VideoCapture("http://@192.168.1.6:86/")
   while cap.isOpened():
       _,frame = cap.read()
       cv2.imshow("stream",frame)
       c = cv2.waitKey(1)
       if c == 27:
           break