Adding custom video format to Qt using QtMultimedia
I've a proprietary video format and need to implement it in Qt. As always there are multiple solutions available. This time I picked the one to implement my custom QMediaService and QMediaObjects.
Unfortunally I cannot play it. My observations:
- Qt loads the plugin (metadata contains the org.qt-project.qt.mediaplayer service)
- Qt loads the system plugin (DirectShow plugin)
- Playback file does have a custom file format and mime type, registered by creating an additional mime type database according to the docs (XML)
- Plugin provides the Playback feature
- Plugin provides the QMediaServiceSupportedFormatsInterface (for the specific mime type)
- The provided QVideoRendererControl in my plugin is never called, instead Qt picks DirectShow to try playback
It seems that QMediaPlayer is careless when it comes to mime types. It just picks the first available media service and tries it. And if it fails then that's it.
Some extra information regarding my system:
Visual Studio 2015
Qt 5.9.0 (x86 build as provided by Qt)
Did someone encountered the same problem and have some advice to tackle it? Or did I just stumble upon a Qt bug / design issue?
Another option would be not using the plugin system, but hey I thought it is made for it, so lets try it out...
As a workaround, you can move the Qt plugins out of the corresponding folder so yours can be loaded.
You situation is likely related to this QTBUG-32783.
Thanks, didn't found the mentioned bugreport earlier. Probably due to it is not on the QMultimedia board.
It is not the workaround I'm looking for because the support for all other formats are gone then. For know I will make a custom QObject that can be attached to a VideoOutput object. That's ok for now.