0

As the title says my cv2.VideoCapture("bebop.sdp") is not working. The only debug information I can get is that isOpened() returns False.

videoFeed = cv2.VideoCapture("bebop.sdp")
while True:

    ret, currentVideoFrame = videoFeed.read()
    if ret:
        cv2.imshow('frame',currentVideoFrame)
        cv2.waitKey(1)
    else:
        print("FrameError - %s" % videoFeed.isOpened())

Replacing bebop.sdp with a sample.mp4 file works fine. bebop.sdp is definitely in the working directory (alongside sample.mp4). I have an ffmpeg dll here: "C:\Users\uname\AppData\Local\Programs\Python\Python36\opencv_ffmpeg331_64.dll". The code worked fine with python2.7 (although I do remember having a similar problem, but the dll fixed that.

I can open the bebop.sdp file in VLC and I receive the video I expect.

Is there any debugging information I can get access to?

Thanks in advance!

Andy
  • 21
  • 1
  • 4
  • Check this: https://stackoverflow.com/a/47116576/5008845 – Miki Dec 04 '17 at 17:44
  • And you are sure `bebop.sdp` is in the same directory you are executing this script from? – user1767754 Dec 04 '17 at 18:09
  • Neither of these solved the problem. I tried going back a step and using ffplay rather than opencv. This initially did not work but then I realised that ffplay was being blocked by the firewall. Disabling the firewall allowed the ffplay method to work, but using the openCV method instead is still saying the stream is not open. – Andy Dec 05 '17 at 11:47

2 Answers2

0

I managed to circumvent the problem by downloading python3.4.4 and installing OpenCV version 3.1.0.5. No idea why later versions are problematic!

Andy
  • 21
  • 1
  • 4
0

Maybe because the different FFMPEG Version.

new FFMPEG use ffplay xxx.sdp will get error.

Instead you should add -porotocol_whitelist file,rtp,udp before sdp file.

I think that's the same reason.

  • That sounds like a good explanation. Please post the code needed to answer question by [edit]ing your answer. – Tom Aranda Dec 14 '17 at 02:58