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. Play a video on qt 5.12 c++
Forum Updated to NodeBB v4.3 + New Features

Play a video on qt 5.12 c++

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 4 Posters 3.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.
  • A AliM93

    Hello everybody :)
    I'm trying to play a video in my c++ GUI, i found that i need to include in my scripts QMediaplayer and QVideoWidgets, but I got the error 'no such file or directory' .

    I'm using Qt creator 4.9.2 Based on Qt 5.12.4, running on ubuntu 18.04.
    How can i install them?

    thanks
    good day everyone

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

    @AliM93 Did you add

    QT += multimedia
    

    to your pro file (see https://doc.qt.io/qt-5/qmediaplayer.html)?

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

    A 1 Reply Last reply
    2
    • jsulmJ jsulm

      @AliM93 Did you add

      QT += multimedia
      

      to your pro file (see https://doc.qt.io/qt-5/qmediaplayer.html)?

      A Offline
      A Offline
      AliM93
      wrote on last edited by
      #3

      @jsulm i'm using a cmake file,, not qmake, so i don't have the .pro file. I've tried to add in my cmake script these lines:

      find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Sql Multimedia)

      target_link_libraries(agree_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}
      (
      Qt5::Multimedia
      )

      but i got this error:
      :-1: error: cannot find -lQt5::Multimedia

      jsulmJ Pablo J. RoginaP 2 Replies Last reply
      0
      • A AliM93

        @jsulm i'm using a cmake file,, not qmake, so i don't have the .pro file. I've tried to add in my cmake script these lines:

        find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Sql Multimedia)

        target_link_libraries(agree_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}
        (
        Qt5::Multimedia
        )

        but i got this error:
        :-1: error: cannot find -lQt5::Multimedia

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

        @AliM93 How was Qt installed?

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

        A 1 Reply Last reply
        0
        • jsulmJ jsulm

          @AliM93 How was Qt installed?

          A Offline
          A Offline
          AliM93
          wrote on last edited by
          #5

          @jsulm from the terminal

          jsulmJ 1 Reply Last reply
          0
          • A AliM93

            @jsulm from the terminal

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

            @AliM93 said in Play a video on qt 5.12 c++:

            from the terminal

            This doesn't tell much.
            Did you use apt to install Qt packages from Ubuntu? If so, did you install libqt5multimedia package?

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AliM93
              wrote on last edited by
              #7
              This post is deleted!
              1 Reply Last reply
              0
              • A Offline
                A Offline
                AliM93
                wrote on last edited by
                #8

                in the qt lib i have these libraries : the path is : QtCreator/latest/lib/Qt

                • libQt5Multimedia.so.5
                • libQt5Multimedia.so.5.12
                • libQt5Multimedia.so.5.12.4
                • libQt5MultimediaGstTools.so.5 (.12 .12.4)
                • libQt5MultimediaQuick.so.5 (.12 .12.4)
                • libQt5MultimediaWidgets.so.5 (.12 .12.4)
                jsulmJ 1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  Hi,

                  You did not answer @jsulm's question: how exactly did you install Qt ? Using the Qt Online Installer ? Using your distribution package manager ?

                  Also how did you install Qt Creator ?

                  If you installed Qt using the package manager, you have to install the corresponding development packages.

                  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
                  • A AliM93

                    in the qt lib i have these libraries : the path is : QtCreator/latest/lib/Qt

                    • libQt5Multimedia.so.5
                    • libQt5Multimedia.so.5.12
                    • libQt5Multimedia.so.5.12.4
                    • libQt5MultimediaGstTools.so.5 (.12 .12.4)
                    • libQt5MultimediaQuick.so.5 (.12 .12.4)
                    • libQt5MultimediaWidgets.so.5 (.12 .12.4)
                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @AliM93 said in Play a video on qt 5.12 c++:

                    QtCreator/latest/lib/Qt

                    This looks like the installation directory of QtCreator which doesn't matter.
                    Again: how exactly did you install Qt? Did you install Qt packages provided by your distribution (via apt)?
                    Please answer the questions else nobody will be able to help you.

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

                    A 1 Reply Last reply
                    0
                    • A AliM93

                      @jsulm i'm using a cmake file,, not qmake, so i don't have the .pro file. I've tried to add in my cmake script these lines:

                      find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Sql Multimedia)

                      target_link_libraries(agree_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}
                      (
                      Qt5::Multimedia
                      )

                      but i got this error:
                      :-1: error: cannot find -lQt5::Multimedia

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #11

                      @AliM93 said in Play a video on qt 5.12 c++:

                      :-1: error: cannot find -lQt5::Multimedia

                      I guess you may need to try a different name for the library...

                      target_link_libraries(agree_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}
                      (
                      Qt5Multimedia
                      )
                      

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      A 1 Reply Last reply
                      0
                      • Pablo J. RoginaP Pablo J. Rogina

                        @AliM93 said in Play a video on qt 5.12 c++:

                        :-1: error: cannot find -lQt5::Multimedia

                        I guess you may need to try a different name for the library...

                        target_link_libraries(agree_gui ${QT_LIBRARIES} ${catkin_LIBRARIES}
                        (
                        Qt5Multimedia
                        )
                        
                        A Offline
                        A Offline
                        AliM93
                        wrote on last edited by
                        #12

                        @Pablo-J-Rogina i've tried but same error.

                        1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @AliM93 said in Play a video on qt 5.12 c++:

                          QtCreator/latest/lib/Qt

                          This looks like the installation directory of QtCreator which doesn't matter.
                          Again: how exactly did you install Qt? Did you install Qt packages provided by your distribution (via apt)?
                          Please answer the questions else nobody will be able to help you.

                          A Offline
                          A Offline
                          AliM93
                          wrote on last edited by
                          #13

                          @jsulm https://ros-qtc-plugin.readthedocs.io/en/latest/_source/How-to-Install-Users.html
                          i used this link because i need also to install the ros plugin. i followed the bionic online installer

                          jsulmJ Pablo J. RoginaP 2 Replies Last reply
                          0
                          • A AliM93

                            @jsulm https://ros-qtc-plugin.readthedocs.io/en/latest/_source/How-to-Install-Users.html
                            i used this link because i need also to install the ros plugin. i followed the bionic online installer

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

                            @AliM93 That link describes how to install QtCreator (not Qt) and a QtCreator plug-in. So, my question is still not answered...

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

                            A 1 Reply Last reply
                            0
                            • jsulmJ jsulm

                              @AliM93 That link describes how to install QtCreator (not Qt) and a QtCreator plug-in. So, my question is still not answered...

                              A Offline
                              A Offline
                              AliM93
                              wrote on last edited by
                              #15

                              @jsulm i used this and only this one so maybe i did not install Qt

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

                                Then it's not a maybe, you just have installed Qt Creator.

                                In any case, are you trying to build a Qt application for ROS or just a Qt application ?

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

                                A 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  Then it's not a maybe, you just have installed Qt Creator.

                                  In any case, are you trying to build a Qt application for ROS or just a Qt application ?

                                  A Offline
                                  A Offline
                                  AliM93
                                  wrote on last edited by
                                  #17

                                  @SGaist i''m trying to build a qt application for ROS

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

                                    Then install Qt.

                                    Where did you get Qt Creator from ?

                                    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
                                    • A Offline
                                      A Offline
                                      AliM93
                                      wrote on last edited by
                                      #19

                                      @SGaist I got it from the link that i posted. I follow that link and then i installed qt creator with the ROS plugin.
                                      How can i install qt?

                                      I noticed that in my Qt creator folder i have also this path:
                                      QtCreator -> latest -> lib -> Qt --> (...)
                                      may this mean i have also installed Qt? The code i wrote since now works well. is it possible that i installed only Qt Creator without Qt?

                                      Sorry for my bad installation skills.
                                      thank you all.

                                      jsulmJ 1 Reply Last reply
                                      0
                                      • A AliM93

                                        @SGaist I got it from the link that i posted. I follow that link and then i installed qt creator with the ROS plugin.
                                        How can i install qt?

                                        I noticed that in my Qt creator folder i have also this path:
                                        QtCreator -> latest -> lib -> Qt --> (...)
                                        may this mean i have also installed Qt? The code i wrote since now works well. is it possible that i installed only Qt Creator without Qt?

                                        Sorry for my bad installation skills.
                                        thank you all.

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

                                        @AliM93 said in Play a video on qt 5.12 c++:

                                        QtCreator -> latest -> lib -> Qt --> (...)
                                        may this mean i have also installed Qt?

                                        No, these are Qt libraries used by QtCreator (QtCreator is a Qt application).
                                        "is it possible that i installed only Qt Creator without Qt?" - I think so, as the link you posted only talks about QtCreator installation.

                                        "How can i install qt?" - you can use Qt Online Installer (from official Qt web site). On Linux you can install Qt packages provided by the Linux distribution.

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

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          AliM93
                                          wrote on last edited by
                                          #21

                                          Thanks.

                                          And may the qt installation change something in my Qt creator application?
                                          Sorry buy i'm terrified by the fact that i cannot use anymore the ROS plugin and so the application i implemented since now.

                                          thanks.

                                          jsulmJ 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