title: libvlc "VLC is unable to open the MRL 'C:\Users\Public\Videos\Sample Videos\Wildlife.mwv'"
body: <p>I am writing a PySide Python application that interfaces with VLC. Works just fine running on Ubuntu, but when I move to Windows, I can't even get VLC to open a video file.</p>
  
  <p>I trimmed the VideoLAN PyQt example (<a href="http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=examples/qtvlc.py;h=34aeedce116e05f575eb0ebffdacf8f06db80402;hb=HEAD" rel="nofollow">http://git.videolan.org/?p=vlc/bindings/python.git;a=blob;f=examples/qtvlc.py;h=34aeedce116e05f575eb0ebffdacf8f06db80402;hb=HEAD</a>) down to just a window and video player to try to figure out what's going wrong, and still get this error. Even when using the return from the open file dialog, I still get the same error.</p>
  
  <p>Below is the very trimmed down version of the VideoLAN example:</p>
  
  <pre><code>import sys
  import vlc
  import user
  from ctypes import pythonapi, c_void_p, py_object
  from PySide import QtGui, QtCore
  
  class Player(QtGui.QMainWindow):
    def __init__(self, master = None):
      QtGui.QMainWindow.__init__(self, master)
  
      self.setWindowTitle('Media Player')
  
      self.instance = vlc.Instance()
      self.mediaplayer = self.instance.media_player_new()
  
      self.createUI()
  
    def createUI(self):
      self.widget = QtGui.QWidget(self)
      self.setCentralWidget(self.widget)
  
      self.videoframe = QtGui.QFrame()
      self.palette = self.videoframe.palette()
      self.palette.setColor(QtGui.QPalette.Window,
                            QtGui.QColor(0, 0, 0))
      self.videoframe.setPalette(self.palette)
      self.videoframe.setAutoFillBackground(True)
  
      self.vboxlayout = QtGui.QVBoxLayout()
      self.vboxlayout.addWidget(self.videoframe)
  
      self.widget.setLayout(self.vboxlayout)
  
      self.OpenFile()
  
    def OpenFile(self, filename = None):
      if filename is None:
        filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', user.home)
        filename = filename[0]
      if not filename:
        return
  
      print filename
      self.media = self.instance.media_new(unicode(filename))
      self.mediaplayer.set_media(self.media)
  
      self.media.parse()
      self.setWindowTitle(self.media.get_meta(0))
  
      if sys.platform == 'linux2':
        self.mediaplayer.set_xwindow(self.videoframe.winId())
      elif sys.platform == 'win32':
        pythonapi.PyCObject_AsVoidPtr.restype = c_void_p
        pythonapi.PyCObject_AsVoidPtr.argtypes = [py_object]
        hWnd = pythonapi.PyCObject_AsVoidPtr(self.videoframe.winId())
        self.mediaplayer.set_hwnd(hWnd)
      elif sys.platform == 'darwin':
        self.mediaplayer.set_agl(self.videoframe.windId())
  
      self.mediaplayer.play()
  
  if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    player = Player()
    player.show()
    player.resize(640, 480)
  
    sys.exit(app.exec_())
  </code></pre>