<font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">I'm having an issue using the Phonon
VideoPlayer.</font>
<br><font size=2 face="sans-serif">Loading or starting to play a video
file causes the python executable to crash, leaving me only with a windows
dialog saying that "python.exe has stopped working".</font>
<br>
<br><font size=2 face="sans-serif">I've boiled it down to the following,
minimalistic example:</font>
<br>
<br><tt><font size=2>import sys</font></tt>
<br>
<br><tt><font size=2>from PyQt4.phonon import Phonon</font></tt>
<br><tt><font size=2>from PyQt4 import QtGui, QtCore</font></tt>
<br><tt><font size=2>import PyQt4.QtCore</font></tt>
<br>
<br><tt><font size=2>import os</font></tt>
<br>
<br><tt><font size=2>class TestPlayer(QtGui.QMainWindow):</font></tt>
<br><tt><font size=2> def __init__(self):</font></tt>
<br><tt><font size=2> QtGui.QMainWindow.__init__(self)</font></tt>
<br><tt><font size=2> widget = QtGui.QWidget()</font></tt>
<br><tt><font size=2> layout = QtGui.QVBoxLayout()</font></tt>
<br><tt><font size=2> widget.setLayout(layout)</font></tt>
<br>
<br><tt><font size=2> self.setCentralWidget(widget)</font></tt>
<br>
<br><tt><font size=2> self.player = Phonon.VideoPlayer()</font></tt>
<br><tt><font size=2> layout.addWidget(self.player)</font></tt>
<br>
<br><tt><font size=2> start = QtGui.QPushButton('Start')</font></tt>
<br><tt><font size=2> start.clicked.connect(self.select_and_play)</font></tt>
<br><tt><font size=2> layout.addWidget(start)</font></tt>
<br>
<br><tt><font size=2> self.mediaSource = None</font></tt>
<br>
<br><tt><font size=2> def select_and_play(self):</font></tt>
<br><tt><font size=2> f = QtGui.QFileDialog.getOpenFileName(None,
'File :-)')</font></tt>
<br><tt><font size=2> f = os.path.normpath(unicode(f))</font></tt>
<br><tt><font size=2> print 'playing: %s' %
f</font></tt>
<br><tt><font size=2> self.mediaSource = Phonon.MediaSource(f)</font></tt>
<br><tt><font size=2> self.player.load(self.mediaSource)</font></tt>
<br><tt><font size=2> self.player.play()</font></tt>
<br>
<br><tt><font size=2>if __name__ == '__main__':</font></tt>
<br><tt><font size=2> print 'pyqt: %s' % PyQt4.QtCore.PYQT_VERSION_STR</font></tt>
<br><tt><font size=2> print 'qt: %s' % PyQt4.QtCore.QT_VERSION_STR</font></tt>
<br><tt><font size=2> print 'py version: %s' % sys.version</font></tt>
<br>
<br><tt><font size=2> app = QtGui.QApplication([])</font></tt>
<br><tt><font size=2> tester = TestPlayer()</font></tt>
<br><tt><font size=2> tester.show()</font></tt>
<br><tt><font size=2> app.exec_()</font></tt>
<br>
<br>
<br><font size=2 face="sans-serif">This gives:</font>
<br>
<br><tt><font size=2>pyqt: 4.10.4</font></tt>
<br><tt><font size=2>qt: 4.8.5</font></tt>
<br><tt><font size=2>py version: 2.7.6 (default, Nov 10 2013, 19:24:18)
[MSC v.1500 32 bit (Intel)]</font></tt>
<br><tt><font size=2>playing: C:\Users\Public\Videos\Sample Videos\Wildlife.wmv</font></tt>
<br>
<br><font size=2 face="sans-serif">This is on a Windows 7 64bit System
using the portable python distribution:</font>
<br><a href=ftp://ftp.nluug.nl/pub/languages/python/portablepython/v2.7/PortablePython_2.7.6.1.exe><font size=2 color=blue face="sans-serif">ftp://ftp.nluug.nl/pub/languages/python/portablepython/v2.7/PortablePython_2.7.6.1.exe</font></a>
<br><font size=2 face="sans-serif">I tried this with PyQt versions from
4.9.6, 4.10.4 to the latest as of yesterday using "normal" python
installations as well, without any success.</font>
<br><font size=2 face="sans-serif">The video file should be available on
any windows 7 installation.</font>
<br>
<br><font size=2 face="sans-serif">Remarkably, all the Phonon examples
included in PyQt are working just fine - though no Video example is included
therein.</font>
<br>
<br><font size=2 face="sans-serif">Any hints on where to start looking
for the issue here?</font>
<br>
<br><font size=2 face="sans-serif">Cheers</font>
<br><font size=2 face="sans-serif">Sebastian</font>