I'm starting to play with Opencv. I am using the python bindings for opencv2 on Linux. I wrote a quick test program but it seems to hang indefinitely.
import cv2
weblink = "http://continuous-video-stream-here"
cv2.namedWindow("video")
vid = cv2.VideoCapture(weblink)
key = -1
while (key < 0):
success, img = vid.read()
cv2.imshow("video", img)
But it hangs on this output:
(video:14388): GStreamer-CRITICAL **: gst_caps_unref: assertion `caps != NULL' failed
I have also tried reading from urllib2:
vid = cv2.VideoCapture(urllib2.urlopen(weblink).read())
But that didn't work either.
I am using Opencv 2.4.2, ffmpeg-0.11.2
EDIT: The video feed uses realplayer to display the video over http in the browser.