Reputation: 116
I'm desperately attempting to load a video file in OpenCV in Python (on OSX Lion) using the following code:
> import cv
> capture = cv.CaptureFromFile("in.avi")
However, i only get the following warning:
> WARNING: Couldn't read movie file in.avi
There is no explanation as to what the problem is (it can't find the file, wrong codec, etc). As far as Google is concerned I'm the only one in the universe getting this exact message in OpenCV.
I've read the 'codec compatibility docs' here and made sure to convert the video to the correct codec using mencode, but it still doesn't work.
Any ideas as to what I'm doing wrong?
Upvotes: 5
Views: 6165
Reputation: 568
Alternatively, support home folders and replace relative paths to absolute ones using
#import os
...
path = os.path.abspath(os.path.expanduser(path))
Upvotes: 0