在OpenCV Python中打开DivX/XVID视频 [英] Open DivX/XVID videos in OpenCV Python
问题描述
我开始在新计算机上工作,试图像以前一样设置所有旧计算机.不幸的是,切换到64位Windows使得一切都变得很困难.
I started working on a new computer a tried to set everything as it used to be on my old one. Unfortunately switching to 64bit Windows made everything quite difficult.
在当前设置下,我只能打开用memcoder转换的原始I420视频,但不能打开以前在旧PC上使用的DivX/XVID视频.我尝试了ffdshow和K-Lite编解码器包.在gspot中打开视频,表明确实已安装了编解码器.
With the current setup I can only open raw I420 videos converted with memcoder, but I can't open DivX/XVID videos, that I used to on my old PC. I tried ffdshow and K-Lite codec pack. Opening the videos in gspot shows that the codecs are indeed installed.
我已经在整个Internet上搜索了解决方案,但是找不到解决方案.我尝试将ffmpeg dll复制到Python27文件夹中.
I've searched for solution all over the Internet, but I couldn't find the solution. I've tried copying the ffmpeg dll into the Python27 folder.
环境为64位Windows 7 Pro
The environment is 64bits Windows 7 Pro
我尝试使用OpenCV保存视频:
I tried saving a video using OpenCV:
我将-1传递给cv2.VideoWriter函数以获取编解码器选择对话框.该对话框不显示ffdshow编解码器.
I passed -1 to the cv2.VideoWriter function to get the codec selection dialog. The dialog dosn't show the ffdshow codecs.
推荐答案
我终于解决了这个问题.
I solved the problem finally.
Windows7 x64 + Python 2.7 x86 + NumPy x86 + ffdshow x86 + Eclipse x64是必经之路.一切都像魅力一样运作.但是,其他程序(例如VirtualDub)也需要x64 ffdshow.
Windows7 x64 + Python 2.7 x86 + NumPy x86 + ffdshow x86 + Eclipse x64 is the way to go. Everything is working like a charm. x64 ffdshow is also required for other programs like VirtualDub though.
这篇关于在OpenCV Python中打开DivX/XVID视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!