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 9.0k 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.
  • T Offline
    T Offline
    tomy
    wrote on 3 Feb 2022, 18:01 last edited by tomy 2 Mar 2022, 18:01
    #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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Feb 2022, 19:21 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

      T 1 Reply Last reply 3 Feb 2022, 20:46
      0
      • S SGaist
        3 Feb 2022, 19:21

        Hi,

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

        T Offline
        T Offline
        tomy
        wrote on 3 Feb 2022, 20:46 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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 3 Feb 2022, 20:58 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

          T 1 Reply Last reply 3 Feb 2022, 21:00
          0
          • S SGaist
            3 Feb 2022, 20:58

            That's what I had I mind.

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

            T Offline
            T Offline
            tomy
            wrote on 3 Feb 2022, 21:00 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
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 3 Feb 2022, 21:01 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

              T 1 Reply Last reply 3 Feb 2022, 21:05
              0
              • S SGaist
                3 Feb 2022, 21:01

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

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

                T Offline
                T Offline
                tomy
                wrote on 3 Feb 2022, 21:05 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
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 3 Feb 2022, 21:07 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

                  T 1 Reply Last reply 4 Feb 2022, 09:45
                  0
                  • S SGaist
                    3 Feb 2022, 21:07

                    The second case.

                    T Offline
                    T Offline
                    tomy
                    wrote on 4 Feb 2022, 09:45 last edited by tomy 2 Apr 2022, 09:45
                    #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
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 4 Feb 2022, 20:55 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

                      T 1 Reply Last reply 5 Feb 2022, 09:18
                      0
                      • S SGaist
                        4 Feb 2022, 20:55

                        Did you successfully build the example ?

                        T Offline
                        T Offline
                        tomy
                        wrote on 5 Feb 2022, 09:18 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 5 Feb 2022, 16:01 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.

                          T 1 Reply Last reply 5 Feb 2022, 18:04
                          3
                          • MarkkyboyM Markkyboy
                            5 Feb 2022, 16:01

                            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.

                            T Offline
                            T Offline
                            tomy
                            wrote on 5 Feb 2022, 18:04 last edited by tomy 2 May 2022, 18:05
                            #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 5 Feb 2022, 20:16
                            1
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 5 Feb 2022, 19:42 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
                              • T tomy
                                5 Feb 2022, 18:04

                                @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 5 Feb 2022, 20:16 last edited by Markkyboy 2 May 2022, 20:19
                                #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.

                                T 1 Reply Last reply 5 Feb 2022, 21:14
                                1
                                • MarkkyboyM Markkyboy
                                  5 Feb 2022, 20:16

                                  @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.

                                  T Offline
                                  T Offline
                                  tomy
                                  wrote on 5 Feb 2022, 21:14 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 5 Feb 2022, 21:58
                                  0
                                  • T tomy
                                    5 Feb 2022, 21:14

                                    @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 5 Feb 2022, 21:58 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 6 Nov 2024, 20:17 last edited by QtWorld 11 Jun 2024, 20:18
                                      #18
                                      This post is deleted!
                                      jsulmJ 1 Reply Last reply 7 Nov 2024, 07:01
                                      0
                                      • Q QtWorld
                                        6 Nov 2024, 20:17

                                        This post is deleted!

                                        jsulmJ Offline
                                        jsulmJ Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on 7 Nov 2024, 07:01 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 7 Nov 2024, 08:02 last edited by QtWorld 11 Jul 2024, 08:05
                                          #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