Which file formats (or codecs) does QMediaPlayer support?
-
I am looking through the documentation of QMediaPlayer and all the classes used within. However, the best answers I could get are:
(http://doc.qt.io/qt-5/multimediaoverview.html#limitations)Qt Multimedia features for Windows are implemented in two plugins; one using the Microsoft DirectShow API, and another using WMF (Windows Media Foundation) framework.
And also:
(http://doc.qt.io/qt-5/qtmultimedia-windows.html)The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs or containers can vary between machines, depending on what the end user has installed.
Nowhere else in the documentation is specified how this actually works. How do I determine what can be played and what not? More specific, which file formats are supported (mp3, aac, flac, ogg, wav, ect...)?
I am also aiming at a crossplatform project (even though I will target Windows at first), which also brings the question of which file formats are supported on Linux and Mac OS X?
And if some file formats are not supported, what can I do to support them? Would it work by installing some external codecs - like on Windows, the K-Lite codecs pack? Or should I write my own code (or use a library) to decode the files and then play some raw (already decoded) audio samples? -
For Windows check: Supported Formats In DirectsShow
For OSX: Media formats supported by QuickTime PlayerFor Linux it really depends on the installed Gstreamer plugins,
this can boil down to nothing or pretty much any media codec
out there.For Linux you need to just simply specify that the application depends
on the specific gstreamer-plugins-{bad,base,ugly,good} plugin package
that contains support for the codec you need.For windows installing a codec pack is one solution, ffdshow might be
a good solution.Also simply using Gstreamer directly would be one option if more
advanced media capability is needed, this also guarantees that same set of
functionality is available on all platforms. -
Awesome info, really thank you very much!
Now that I read those links, looks like it would be enough for someone to have the proper codecs installed without requiring further assistence from my side. For windows in particular, some codecs pack like the aforementioned K-Lite should be just enough.Again, thank you ;)