[PyQt] Antwort: 回复: Phonon VideoPlayer causes python to crash

Sebastian Eckweiler sebastian.eckweiler at twt-gmbh.de
Fri Jun 6 08:34:50 BST 2014


FWIW:

This error was obviously caused by a bug/incompatibility with my graphics 
drivers (nvidia D3D Shim Drivers, version 268.xx).
After updating them to the latest version, things are fine.

Cheers,
Sebastian



Von:    Sebastian Eckweiler <sebastian.eckweiler at twt-gmbh.de>
An:     "iMath" <2281570025 at qq.com>
Kopie:  pyqt <pyqt at riverbankcomputing.com>
Datum:  05.06.2014 18:46
Betreff:        [PyQt] 回复: Phonon VideoPlayer causes python to crash
Gesendet von:   "PyQt" <pyqt-bounces at riverbankcomputing.com>




This is part of a larger project - changing to PyQt5 is probably not a 
possibility.

Maybe I should add:
Everything is fine on the machines of other colleagues, while things go 
wrong on my and on a second machine.
I checked though that all machines are running the same python & pyqt 
versions and they all are windows 7...

Cheers,
Sebastian


-----"iMath" <2281570025 at qq.com> schrieb: ----- 
An: "Sebastian Eckweiler" <sebastian.eckweiler at twt-gmbh.de>, "pyqt" 
<pyqt at riverbankcomputing.com>
Von: "iMath" <2281570025 at qq.com>
Datum: 05.06.2014 16:20
Betreff: 回复:[PyQt] Phonon VideoPlayer causes python to crash

why not try 
QMediaPlayer in PyQt5 ?
http://qt-project.org/doc/qt-5/qmediaplayer.html

Phonon was dropped since Qt5.
------------------ 原始邮件 ------------------
发件人:  "Sebastian Eckweiler";<sebastian.eckweiler at twt-gmbh.de>;
发送时间: 2014年6月3日(星期二) 晚上7:12
收件人: "pyqt"<pyqt at riverbankcomputing.com>; 
主题: [PyQt] Phonon VideoPlayer causes python to crash

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" pythoninstallations as well, without any success. 

The video file should be available on any windows 7 installation.

Remarkably, all the Phonon examplesincluded 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_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140606/2ebda023/attachment-0001.html>


More information about the PyQt mailing list