title: VideoCapture() opencv python pyinstaller not opening
body: <p>I am trying to produce an .exe of a simple GUI made with PyQt4 in python 2.7 using pyinstaller to play a video.</p>
  
  <p>Here are the details of my problem:</p>
  
  <p>Simple layout with two buttons, one to load video, other to play video. In my IDE, the video loads and plays perfectly. The video pops up in another window and closes when it is over. </p>
  
  <p>After running pyinstaller on the program, the GUI interface pops up after running the .exe. The open file dialog works correctly, however the video will not play. </p>
  
  <p>In my IDE I can reproduce the error by removing <em>opencv_ffmpeg2412_64.dll</em> from the opencv installation directory. Removing anything else in the directory does not seem to affect the playability of the video within the IDE. So I figure that pyinstaller is not finding opencv_ffmpeg2412_64.dll. I have tried to manually copy it into the dist folder produced by pyinstaller. I have also tried to hook it as well as include it in the specFile. I must be doing something wrong or looking in the wrong place to try and solve this issue.</p>
  
  <p>Any ideas on how I could fix this would be much appreciated. Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>Here is the main part of my code if it can be any help. This is only a test of a larger GUI that I am trying to place in an .exe file. I am using an older version of cv2 because of forwards compatibility problems.</p>
  
  <pre><code>#imports
  import sys
  
  from PyQt4.QtGui import *
  from PyQt4.QtCore import *
  from PyQt4 import QtCore
  from PyQt4.QtGui import QFileDialog
  
  import cv2
  import numpy
  
  import mainwindow
  
  
  class MainWindow(QMainWindow, mainwindow.Ui_MainWindow):
  
      def __init__(self, parent=None):
          super(MainWindow, self).__init__(parent)
          self.setupUi(self)
  
          self.Load_B.clicked.connect(self.open)
          self.Play_B.clicked.connect(self.play)
  
      def play(self):
  
  
          cap = cv2.VideoCapture(self.video)
          while(True):
              (grabbed, frame) = cap.read()
              if not grabbed:
                  break            
              currentframe = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
              height, width = currentframe.shape[:2]
              cv2.namedWindow("Preview", cv2.WINDOW_NORMAL) 
              cv2.imshow("Preview",currentframe)  
  
              if cv2.waitKey(1) &amp; 0xFF == ord('q'):
                  break  
          cap.release()
          cv2.destroyAllWindows()  
  
      def open(self):
          self.video=QFileDialog.getOpenFileName(self,"Video file",filter="Video 
      Files (*.mp4)")
  
  
  app = QApplication(sys.argv)
  app.aboutToQuit.connect(app.deleteLater)
  form = MainWindow()
  form.show()
  app.exec_()
  </code></pre>