Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Switch QMultiMedia backend without recompiling whole Qt
Forum Updated to NodeBB v4.3 + New Features

Switch QMultiMedia backend without recompiling whole Qt

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 5 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Hi,

    IIRC, the MSVC edition comes with both backends. What you can do is temporarily move the DirectX backend in another folder to see if that does what you want.

    Otherwise, you don't need to build all of Qt, just the qtmultmedia module.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    J 1 Reply Last reply
    0
    • J Offline
      J Offline
      jsmolka
      wrote on last edited by
      #5
      This post is deleted!
      1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        IIRC, the MSVC edition comes with both backends. What you can do is temporarily move the DirectX backend in another folder to see if that does what you want.

        Otherwise, you don't need to build all of Qt, just the qtmultmedia module.

        J Offline
        J Offline
        jsmolka
        wrote on last edited by
        #6

        @SGaist I have read something simular and compared to the MinGW version the MSVC version comes with precompiled binaries in the form of wmfengine.dll under plugins/mediaservice. But if I remove the dsengine.dll files I get the following console output when starting my application: defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer".

        Am I removing the wrong files?

        Apart from that I have successfully compiled the previous Qt version (5.10.0) with the -mediaplayer-backend wmf option. This does not seem to have any effect though because I am still getting DirectShow errors for mp3s with large cover files.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #7

          No, you removed the correct file, however that confirms that the WMF plugin wasn't built with media player capabilities.

          Then do the same you just did with your 5.10.0 custom version to see if it behaves better.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          0
          • SGaistS SGaist

            No, you removed the correct file, however that confirms that the WMF plugin wasn't built with media player capabilities.

            Then do the same you just did with your 5.10.0 custom version to see if it behaves better.

            J Offline
            J Offline
            jsmolka
            wrote on last edited by
            #8

            @SGaist My custom version behaves completely odd. I can literally remove the whole plugins/mediaservice folder and my application is still running and throwing DirectShow errors. I double checked the path for the DLLs and it definitely uses my compiled version.

            I probably made some mistake somewhere along the line but I can't figure out where. I'd really like to use QMultiMedia but the DirectShow backend is destroying it for me. If you have any suggestion for a different configuration and something else I would really appreciate it.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #9

              Then some maybe silly questions:

              • Did you deploy the plugins along your application ?
              • Are you sure that you are using the right kit ?
              • In the Kit, are you sure you are using your custom version of Qt ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply
              2
              • SGaistS SGaist

                Then some maybe silly questions:

                • Did you deploy the plugins along your application ?
                • Are you sure that you are using the right kit ?
                • In the Kit, are you sure you are using your custom version of Qt ?
                J Offline
                J Offline
                jsmolka
                wrote on last edited by
                #10

                @SGaist I am using Qt Creator to build my application and I don't deploy anything beside it at the moment. The path to the DLLs is set in the path environment variable. I made sure that my custom version if being used.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kuzulis
                  Qt Champions 2020
                  wrote on last edited by
                  #11

                  Just download the QtMM sources and compile/install it. And then just remove the 'ds' backend if you do not need in (and keep only the 'wmf' backend).

                  J 1 Reply Last reply
                  0
                  • K kuzulis

                    Just download the QtMM sources and compile/install it. And then just remove the 'ds' backend if you do not need in (and keep only the 'wmf' backend).

                    J Offline
                    J Offline
                    jsmolka
                    wrote on last edited by
                    #12

                    @kuzulis

                    @SGaist I have read something simular and compared to the MinGW version the MSVC version comes with precompiled binaries in the form of wmfengine.dll under plugins/mediaservice. But if I remove the dsengine.dll files I get the following console output when starting my application: defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer".

                    Isn't this what you mean?

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      kuzulis
                      Qt Champions 2020
                      wrote on last edited by
                      #13

                      Yes, that.

                      It is strange that this error:

                      no service found for - "org.qt-project.qt.mediaplayer"

                      occurred.

                      As I can see from QtMM sources:

                      MFPlayerService::MFPlayerService(QObject *parent)
                          : QMediaService(parent)
                          , m_session(0)
                          , m_videoWindowControl(0)
                          , m_videoRendererControl(0)
                      {
                          m_audioEndpointControl = new MFAudioEndpointControl(this);
                          m_session = new MFPlayerSession(this);
                          m_player = new MFPlayerControl(m_session);
                          m_metaDataControl = new MFMetaDataControl(this);
                      } 
                      
                      QMediaControl* MFPlayerService::requestControl(const char *name)
                      {
                          if (qstrcmp(name, QMediaPlayerControl_iid) == 0) {
                              return m_player;
                      

                      }

                      And the wmf.json contains:

                      {
                          "Keys": ["windowsmediafoundation"],
                          "Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiodecode"]
                      } 
                      

                      so, all should be fine.

                      D 1 Reply Last reply
                      1
                      • K kuzulis

                        Yes, that.

                        It is strange that this error:

                        no service found for - "org.qt-project.qt.mediaplayer"

                        occurred.

                        As I can see from QtMM sources:

                        MFPlayerService::MFPlayerService(QObject *parent)
                            : QMediaService(parent)
                            , m_session(0)
                            , m_videoWindowControl(0)
                            , m_videoRendererControl(0)
                        {
                            m_audioEndpointControl = new MFAudioEndpointControl(this);
                            m_session = new MFPlayerSession(this);
                            m_player = new MFPlayerControl(m_session);
                            m_metaDataControl = new MFMetaDataControl(this);
                        } 
                        
                        QMediaControl* MFPlayerService::requestControl(const char *name)
                        {
                            if (qstrcmp(name, QMediaPlayerControl_iid) == 0) {
                                return m_player;
                        

                        }

                        And the wmf.json contains:

                        {
                            "Keys": ["windowsmediafoundation"],
                            "Services": ["org.qt-project.qt.mediaplayer", "org.qt-project.qt.audiodecode"]
                        } 
                        

                        so, all should be fine.

                        D Offline
                        D Offline
                        Devopia53
                        wrote on last edited by Devopia53
                        #14

                        @kuzulis
                        @jsmolka
                        @SGaist

                        However, the service(org.qt-project.qt.mediaplayer) is missing in Qt5.9.* / Qt5.10.* dll. Please check with the following command and let us know the results.

                        like this:
                        QtPluginInfo.exe wnfengine.dll

                        The solution I know must fix the Qt5.10 source. But this is not the official way. I guess it is a bug. The Qt5.7 version has no problem.

                        1 Reply Last reply
                        1
                        • K Offline
                          K Offline
                          kuzulis
                          Qt Champions 2020
                          wrote on last edited by
                          #15

                          Yes, you can try to report it as a bug.

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            jsmolka
                            wrote on last edited by jsmolka
                            #16

                            @kuzulis
                            @Devopia53
                            @SGaist

                            So after some time I got it to work. The solution is just using -mediaplayer-backend wmf as an configure option and then compiling Qt. The reason why I got no error for removing the all files within the plugin folder was that Qt Creator was still using the precompiled binaries even though there was no path set to them. In the end @SGaist was right and asked the right question regarding using the wrong kit.

                            The only thing that still confuses me is qmake crashing while compiling Qt 5.10.1. If I try to compile Qt 5.10.0 everything works just fine. Here are the step I did for compiling (if anybody stumbles across the same problem):

                            1. Download the lastest Qt sources
                            2. Install jom, Python and Perl
                            3. Open cmd and setup your VS environment (with vcvars32.bat, vcvars64 or vsdevenv.bat)
                            4. Configure Qt using configure -debug-and-release -platform win32-msvc -nomake examples -opensource -prefix <insert your install dir> -mediaplayer-backend wmf
                            5. Run jom and later jom install

                            Using the WMF backend seems to be much better for playing mp3s because DirectShow is unable to play files with covers above 100kb and gets the song duration wrong by around 2sec everytime (but it also plays those extra seconds and seems to "expand" the mp3).

                            Thank you guys.

                            1 Reply Last reply
                            1

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved