2

I am trying to open a video stream from IP using

import numpy as np
import cv2

link = 'http://127.0.0.1:8080'

cap = cv2.VideoCapture(link)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Display the resulting frame
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) == 27:
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

I am broadcasting wildlife.wmv from windows' sample videos over http from vlc media player on http, port 8080, h.264. other instances of vlc capture the stream, so I know it is being broadcasted.

I suspect the problem is not a codec problem, because I had those problems, and I solved them using OpenCV 2.4 VideoCapture not working on Windows now I manage to open files, but not urls.

The above code fails to open cap (before the while(True):)

cap.isOpened() returns false, even after using cap.open(url)

What am I getting wrong?

Thanks

Community
  • 1
  • 1
Gulzar
  • 23,452
  • 27
  • 113
  • 201

0 Answers0