[PyQt] Phonon VideoPlayer causes python to crash

Sebastian Eckweiler sebastian.eckweiler at twt-gmbh.de
Tue Jun 3 12:12:02 BST 2014


Hello,

I'm having an issue using the Phonon VideoPlayer.
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".

I've boiled it down to the following, minimalistic example:

import sys

from PyQt4.phonon import Phonon
from PyQt4 import QtGui, QtCore
import PyQt4.QtCore

import os

class TestPlayer(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        widget = QtGui.QWidget()
        layout = QtGui.QVBoxLayout()
        widget.setLayout(layout)

        self.setCentralWidget(widget)

        self.player = Phonon.VideoPlayer()
        layout.addWidget(self.player)

        start = QtGui.QPushButton('Start')
        start.clicked.connect(self.select_and_play)
        layout.addWidget(start)

        self.mediaSource = None

    def select_and_play(self):
        f = QtGui.QFileDialog.getOpenFileName(None, 'File :-)')
        f = os.path.normpath(unicode(f))
        print 'playing: %s' % f
        self.mediaSource = Phonon.MediaSource(f)
        self.player.load(self.mediaSource)
        self.player.play()

if __name__ == '__main__':
    print 'pyqt: %s' % PyQt4.QtCore.PYQT_VERSION_STR
    print 'qt: %s' % PyQt4.QtCore.QT_VERSION_STR
    print 'py version: %s' % sys.version

    app = QtGui.QApplication([])
    tester = TestPlayer()
    tester.show()
    app.exec_()


This gives:

pyqt: 4.10.4
qt: 4.8.5
py version: 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit 
(Intel)]
playing: C:\Users\Public\Videos\Sample Videos\Wildlife.wmv

This is on a Windows 7 64bit System using the portable python 
distribution:
ftp://ftp.nluug.nl/pub/languages/python/portablepython/v2.7/PortablePython_2.7.6.1.exe
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.
The video file should be available on any windows 7 installation.

Remarkably, all the Phonon examples included in PyQt are working just fine 
- though no Video example is included therein.

Any hints on where to start looking for the issue here?

Cheers
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140603/c6eed7ae/attachment.html>


More information about the PyQt mailing list