I am trying to use OpenCV2 with my Conda environment for Python 2.7.
My installation was basically the same as what was described in this question.
I retrieved OpenCV like so:
conda install --channel https://conda.anaconda.org/menpo opencv3
I can import the library cv2 and print the version, which is 3.1.0. So far so good. I can even load an image and display it:
import cv2
img = cv2.imread('desertfloor.jpg')
cv2.imshow('foo',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
This works just fine. But when I go to load a video in the same directory:
vid = cv2.VideoCapture('bbb.avi') # Big Buck Bunny
returnval,frame = vid.read()
print returnval
The returned value is False, which tells me that the frame wasn't returned correctly. When I check vid.isOpened()
, it is False as well. Since it doesn't return an error, it's really hard to tell what's going on. I've heard that ffmpeg can cause some issues if it's not installed properly (whatever that means), but I can't tell if that's what's going on here.
Can anyone tell me why the video isn't opening properly?