Rafael Saraiva
Rafael Saraiva

Reputation: 948

Phonon backend capabilities are too narrow

I created a UI using Qt Designer and am building the logic in pyqt4c. When trying to play either video or audio most formats are not being supported although I am fairly certain they should be.

This is the Phonon.BackendCapabilities.availableMimeTypes() output:

application/kate
application/ogg
application/x-3gp
application/x-ogg-avi
application/x-ogm-audio
application/x-ogm-video
audio/mpeg
audio/ogg
audio/webm
audio/x-alaw
audio/x-amr-nb-sh
audio/x-amr-wb-sh
audio/x-au
audio/x-dts
audio/x-flac
audio/x-m4a
audio/x-matroska
audio/x-mulaw
audio/x-private1-dts
audio/x-sbc
audio/x-speex
audio/x-vorbis
audio/x-vorbis+ogg
audio/x-wav
audio/x-wavpack
multipart/x-mixed-replace
video/mj2
video/ogg
video/quicktime
video/webm
video/x-dv
video/x-fli
video/x-flv
video/x-matroska
video/x-matroska-3d
video/x-msvideo
video/x-theora
video/x-vp8
video/x-vp9

I checked and in /usr/share/mime: I have a huge amount of codecs and I can play any video/audio format in any player: vlc, dragonplayer, mlv, mplayer, etc.

How can I expand my available codecs? Am I supposed to add any path to the phobos class?

Upvotes: 1

Views: 518

Answers (2)

Rafael Saraiva
Rafael Saraiva

Reputation: 948

---------------------------- MY SOLUTION---------------------------------

Since Phonon takes advantage of your system capabilities it is up to you to install libraries to encode and decode media. However, what i did not realize was the necessity to install phonon-qt4 compatible libraries. So:

Using qt4 install:

phonon-qt4-vlc

phonon-qt4-mplayer (unmanaged so possibly out-dated)

Using qt5:

phonon-qt5-vlc (etc)

If anyone has a similar issue and this does not work feel free to post here!

Upvotes: 0

Iskren
Iskren

Reputation: 1331

The currently running phonon backend is responsible for format support. You can switch to a different one to get additional MimeTypes / formats supported.

Read below for a more comprehensive explanation.

Example program:

from PyQt4.QtGui import QApplication
from PyQt4.phonon import Phonon
import sys

app = QApplication(sys.argv)

print len(Phonon.BackendCapabilities.availableMimeTypes())

In KDE System settings -> Multimedia -> Audio and Video Settings -> Backend I have selected "VLC". Running the above produces 89. Going back to the Backend configuration, selecting "GStreamer" and running the script again outputs 213. This means the GStreamer backend supports more MimeTypes than the VLC one. Unfortunately, Phonon's backend is system-wide and you can't override it for a single application, or at least I couldn't find out how by looking at the Phonon class.

Upvotes: 1

Related Questions