[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] phonon video with multiple audio tracks
From:       Miroslav_Míšek <miroslav.misek () gmail ! com>
Date:       2013-07-21 8:01:01
Message-ID: CAFkvf3p5CFLJwTBfquOxfHmTcV5MMs-osenR7H554rDXhcDoGQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

I`m trying to write simple video player with Phonon. It is prety simple,
but i found one problem.

I have few movies with more than one audio tracks in it. Phonon
automatically playes first audio track. But i need to be able list and
choose them.

I tryed:

<code>
class MainWindow(QtGui.QMainWindow):
    def __init__(self, parent = None):
        QtGui.QMainWindow.__init__(self, parent)

        filename = 'movie.avi'

        source = Phonon.MediaSource(filename)
        media = Phonon.MediaObject()
        media.setCurrentSource(source)
        crl = Phonon.MediaController(media)
        print "Channels:\n"
        print crl.availableAudioChannels()
</code>

And output is:

Object::connect: No such signal
Phonon::DS9::MediaObject::availableSubtitlesChan
ged()
Object::connect: No such signal
Phonon::DS9::MediaObject::availableAudioChannels
Changed()
Channels:

[]

No available audio channels found.
Please does anyone know what i am doing wrong?

Thank you,
Miroslav Misek

[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>I`m trying to write simple video player with \
Phonon. It is prety simple, but i found one problem.</div><div><br></div><div>I have \
few movies with more than one audio tracks in it. Phonon automatically playes first \
audio track. But i need to be able list and choose them.</div> <div><br></div><div>I \
tryed:</div><div><br></div><div>&lt;code&gt;</div><div><div>class \
MainWindow(QtGui.QMainWindow):</div><div>    def __init__(self, parent = \
None):</div><div>        QtGui.QMainWindow.__init__(self, parent)</div> \
<div><br></div><div>        filename = &#39;movie.avi&#39;</div><div><br></div><div>  \
source = Phonon.MediaSource(filename)</div><div>        media = \
Phonon.MediaObject()</div><div>        media.setCurrentSource(source)</div> <div>     \
crl = Phonon.MediaController(media)</div><div><span class="" \
style="white-space:pre">		</span></div><div>        print \
&quot;Channels:\n&quot;</div><div>        print \
crl.availableAudioChannels()</div><div>&lt;/code&gt;<br> \
</div></div><div><br></div><div>And output \
is:</div><div><br></div><div><div>Object::connect: No such signal \
Phonon::DS9::MediaObject::availableSubtitlesChan</div><div>ged()</div><div>Object::connect: \
No such signal Phonon::DS9::MediaObject::availableAudioChannels</div> \
<div>Changed()</div><div>Channels:</div><div><br></div><div>[]</div></div><div><br></div><div>No \
available audio channels found.</div><div>Please does anyone know what i am doing \
wrong?</div><div><br></div><div>Thank you,</div> <div>Miroslav Misek</div></div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic