yuxiaorui / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

OpenCV dll's don't work (in particular FFMPEG) #727

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the latest version of Python(x,y). I manually selected to install 
OpenCV, but FFMPEG does not work even though the DLL's are correctly named and 
placed into Python27\Lib\site-packages

To test whether FFMPEG has loaded (with mp4 or x264 file): 

import cv2
cap = cv2.VideoCapture(r'path\to\file.mp4')
print cap.grab()

FIX: It appears that the path to the DLL's need to be included in the PATH 
variable for them to work correctly. I see that other directories from 
Python27\Lib\site-packages were added specifically, but 
Python27\Lib\site-packages was not added as a whole. Is there a reason not to 
do that? Otherwise it would work fine out of the box. 

I am running Windows 8 on a 32-bit system, but I don't think that is the issue. 
Let me know if you are unable to reproduce this error.

Original issue reported on code.google.com by nolan.he...@gmail.com on 31 Mar 2014 at 12:55

GoogleCodeExporter commented 9 years ago
Clarification on symptoms: If the VideoCapture is to a file and you do the 
above, cap.grab() returns False.  For some objects (like an m3u8 live online 
stream), Python will instead crash in opencv_highgui248.dll when trying to 
initialize the VideoCapture object.

Original comment by ays...@gmail.com on 29 Apr 2014 at 8:51

GoogleCodeExporter commented 9 years ago
Good catch. I'll place them in the DLLs dir which is in the path.

Regarding site-packages, I try to adding as few paths as possible to the 
system. 

Original comment by grizzly.nyo on 5 May 2014 at 3:14

GoogleCodeExporter commented 9 years ago
Great, thanks!

Original comment by nolan.he...@gmail.com on 8 May 2014 at 3:51

GoogleCodeExporter commented 9 years ago

Original comment by grizzly.nyo on 1 Jun 2014 at 8:07