Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. module "QtMultimedia" is not installed
Forum Updated to NodeBB v4.3 + New Features

module "QtMultimedia" is not installed

Scheduled Pinned Locked Moved Solved QML and Qt Quick
22 Posts 6 Posters 8.7k Views 2 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.
  • tomyT Offline
    tomyT Offline
    tomy
    wrote on last edited by tomy
    #1

    Hi all,

    I'm testing an .mp3 file in a simple QtQuick (Qt 6.2) app like this:

    import QtQuick
    import QtMultimedia
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        MediaPlayer {
            source: "sounds/startGame.mp3"
            volume: 0.2
            autoPlay: true
        }
    }
    

    CMakeLists.txt:

    cmake_minimum_required(VERSION 3.16)
    
    project(QML_1 VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
    
    qt_add_executable(appQML_1
        main.cpp
    )
    
    qt_add_qml_module(appQML_1
        URI QML_1
        VERSION 1.0
        QML_FILES main.qml 
    
        RESOURCES
            sounds/startGame.mp3
    )
    
    target_compile_definitions(appQML_1
        PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
    target_link_libraries(appQML_1
        PRIVATE Qt6::Quick)
    

    I get this error: module "QtMultimedia" is not installed
    How to solve this, please?

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

      Hi,

      I don't see anything related to the QtMultimedia module in your cmake file.

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

      tomyT 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        I don't see anything related to the QtMultimedia module in your cmake file.

        tomyT Offline
        tomyT Offline
        tomy
        wrote on last edited by
        #3

        @SGaist

        If you mean to work with the following lines:
        find_package(Qt6 COMPONENTS Multimedia REQUIRED)
        target_link_libraries(mytarget PRIVATE Qt6::Multimedia)

        I must say, I did!
        I tried adding both but then it failed.

        Is that what you meant. please?
        If so, how to solve it that way?

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

          That's what I had I mind.

          Can you build the qmlvideo example from Qt's sources ?

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

          tomyT 1 Reply Last reply
          0
          • SGaistS SGaist

            That's what I had I mind.

            Can you build the qmlvideo example from Qt's sources ?

            tomyT Offline
            tomyT Offline
            tomy
            wrote on last edited by
            #5

            @SGaist

            I guess that example (I search for that on Docs) will work out the problem.

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

              If it does, then you know that your installation is fine.

              You can then start from it to build your own application.

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

              tomyT 1 Reply Last reply
              0
              • SGaistS SGaist

                If it does, then you know that your installation is fine.

                You can then start from it to build your own application.

                tomyT Offline
                tomyT Offline
                tomy
                wrote on last edited by
                #7

                @SGaist

                I didn't get your intention properly I guess. Do you mean that the project is written/defined well? (So why I get that error!?)

                Or you mean that I can remedy that issue using that example on Docs?

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

                  The second case.

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

                  tomyT 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    The second case.

                    tomyT Offline
                    tomyT Offline
                    tomy
                    wrote on last edited by tomy
                    #9

                    I searched for a remedy fort the problem on the Docs, but as usual Docs are not helpful except for one who is quite experienced and just walks through it to be sure about something! :|

                    All I collected is that I need to add the following two lines in the project's CmakeLists.txt file:

                    find_package(Qt6 COMPONENTS Multimedia REQUIRED) target_link_libraries(qml_1 PUBLIC Qt::Multimedia)

                    But the project's CmakeLists.txt file already contains those two lines! Should I replace them with these two ones or merge them?

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

                      Did you successfully build the example ?

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

                      tomyT 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Did you successfully build the example ?

                        tomyT Offline
                        tomyT Offline
                        tomy
                        wrote on last edited by
                        #11

                        Do you meant this example?

                        I didn't even find it on the Qt Creator examples section! xcv.PNG

                        So how could I build it?

                        1 Reply Last reply
                        0
                        • MarkkyboyM Offline
                          MarkkyboyM Offline
                          Markkyboy
                          wrote on last edited by
                          #12

                          My 2 penneth :)

                          In examples, just type video into the search bar and look for QML Video Example.

                          But, before you bother with the above example, I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up, might be worth a look.

                          I recently installed Qt6 and found I could not run any multimedia type apps with the same error you have, but checking maintenance tool, I could see it was not included originally, now it's installed and I have just built a basic test app to run an mp3, it works as expected.

                          Don't just sit there standing around, pick up a shovel and sweep up!

                          I live by the sea, not in it.

                          tomyT 1 Reply Last reply
                          3
                          • MarkkyboyM Markkyboy

                            My 2 penneth :)

                            In examples, just type video into the search bar and look for QML Video Example.

                            But, before you bother with the above example, I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up, might be worth a look.

                            I recently installed Qt6 and found I could not run any multimedia type apps with the same error you have, but checking maintenance tool, I could see it was not included originally, now it's installed and I have just built a basic test app to run an mp3, it works as expected.

                            tomyT Offline
                            tomyT Offline
                            tomy
                            wrote on last edited by tomy
                            #13

                            @Markkyboy

                            In examples, just type video into the search bar and look for QML Video Example.

                            I've already done this! :(
                            fgd.PNG

                            I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up

                            I've already done this one as well! But there's no such an item called QtMultimedia to install! :(

                            wew.PNG

                            What is the problem indeed, please? :(

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

                              You can also clone the QtMultimedia module to get the example code.

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

                              1 Reply Last reply
                              0
                              • tomyT tomy

                                @Markkyboy

                                In examples, just type video into the search bar and look for QML Video Example.

                                I've already done this! :(
                                fgd.PNG

                                I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up

                                I've already done this one as well! But there's no such an item called QtMultimedia to install! :(

                                wew.PNG

                                What is the problem indeed, please? :(

                                MarkkyboyM Offline
                                MarkkyboyM Offline
                                Markkyboy
                                wrote on last edited by Markkyboy
                                #15

                                @tomy - did you expand your version in the menu?, if you do, you should see "Additional Libraries" in the list, among the contents, you should find QtMultimedia.

                                In my image, you see I have expanded the version I have installed (Qt 6.2.3)........additional libraries/QtMultimedia.

                                expanded-menu.PNG

                                How odd that you have no examples with your installation, I thought they were automatically included.

                                Don't just sit there standing around, pick up a shovel and sweep up!

                                I live by the sea, not in it.

                                tomyT 1 Reply Last reply
                                1
                                • MarkkyboyM Markkyboy

                                  @tomy - did you expand your version in the menu?, if you do, you should see "Additional Libraries" in the list, among the contents, you should find QtMultimedia.

                                  In my image, you see I have expanded the version I have installed (Qt 6.2.3)........additional libraries/QtMultimedia.

                                  expanded-menu.PNG

                                  How odd that you have no examples with your installation, I thought they were automatically included.

                                  tomyT Offline
                                  tomyT Offline
                                  tomy
                                  wrote on last edited by
                                  #16

                                  @Markkyboy

                                  I installed that API and now I can run the project, but there're new errors!

                                  dsd.PNG

                                  MarkkyboyM 1 Reply Last reply
                                  0
                                  • tomyT tomy

                                    @Markkyboy

                                    I installed that API and now I can run the project, but there're new errors!

                                    dsd.PNG

                                    MarkkyboyM Offline
                                    MarkkyboyM Offline
                                    Markkyboy
                                    wrote on last edited by
                                    #17

                                    @tomy because they are not valid elements of MediaPlayer for Qt6, they are for Qt5.

                                    Nearly all documentation is online for your perusal;

                                    https://doc-snapshots.qt.io/qt6-dev/qml-qtmultimedia-mediaplayer.html

                                    Don't just sit there standing around, pick up a shovel and sweep up!

                                    I live by the sea, not in it.

                                    1 Reply Last reply
                                    3
                                    • Q Offline
                                      Q Offline
                                      QtWorld
                                      wrote on last edited by QtWorld
                                      #18
                                      This post is deleted!
                                      jsulmJ 1 Reply Last reply
                                      0
                                      • Q QtWorld

                                        This post is deleted!

                                        jsulmJ Offline
                                        jsulmJ Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        @QtWorld said in module "QtMultimedia" is not installed:

                                        why i get this error

                                        Because your code is wrong.
                                        Please look here: https://doc.qt.io/qt-6/qml-qtmultimedia-videooutput.html

                                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • Q Offline
                                          Q Offline
                                          QtWorld
                                          wrote on last edited by QtWorld
                                          #20
                                          This post is deleted!
                                          1 Reply Last reply
                                          0

                                          • Login

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