在 Python 中加载 OpenCV 视频
我拼命尝试在 Python 中加载 OpenCV 中的视频文件(在 OSX Lion 上) 使用以下代码:
> import cv
> capture = cv.CaptureFromFile("in.avi")
但是,我只收到以下警告:
> WARNING: Couldn't read movie file in.avi
没有解释问题是什么(它找不到文件,错误的编解码器等)。就 Google 而言,我是世界上唯一在 OpenCV 中得到这一确切消息的人。
我已阅读此处的“编解码器兼容性文档”,并确保使用 将视频转换为正确的编解码器mencode,但还是不行。
关于我做错了什么有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
回答:请参阅我的评论 - 错误的路径。
Answer: See my comment - Wrong path.
或者,支持主文件夹并使用以下命令将相对路径替换为绝对路径
Alternatively, support home folders and replace relative paths to absolute ones using