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. Problem with Qt Multimedia
Forum Updated to NodeBB v4.3 + New Features

Problem with Qt Multimedia

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++multimediaqmediaplayerlogoutqt 5.8
65 Posts 4 Posters 45.9k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 18 Mar 2017, 23:08 last edited by
    #4

    Hi and welcome to devnet,

    You are missing QT += multimediawidgets in your .pro file.

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

    6 1 Reply Last reply 18 Mar 2017, 23:20
    0
    • S SGaist
      18 Mar 2017, 23:08

      Hi and welcome to devnet,

      You are missing QT += multimediawidgets in your .pro file.

      6 Offline
      6 Offline
      6EQUJ5
      wrote on 18 Mar 2017, 23:20 last edited by
      #5

      @SGaist The same problem happens. I tried adding just QT += multimedia, just QT += multimediawidgets, and both of them in my .pro file.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 18 Mar 2017, 23:21 last edited by
        #6

        Did you re-run qmake after modifying the QT variable ?

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

        6 1 Reply Last reply 18 Mar 2017, 23:26
        0
        • S SGaist
          18 Mar 2017, 23:21

          Did you re-run qmake after modifying the QT variable ?

          6 Offline
          6 Offline
          6EQUJ5
          wrote on 18 Mar 2017, 23:26 last edited by
          #7

          @SGaist Yes I did. I cleaned, ran qmake, then rebuilded.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 18 Mar 2017, 23:30 last edited by
            #8

            Ok, can you show how you create your QMediaPlayer object ?

            Re-reading the error message, it seems that you are trying to give it a QObject based parent rather than a QWidget based parent.

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

            6 1 Reply Last reply 18 Mar 2017, 23:52
            0
            • S SGaist
              18 Mar 2017, 23:30

              Ok, can you show how you create your QMediaPlayer object ?

              Re-reading the error message, it seems that you are trying to give it a QObject based parent rather than a QWidget based parent.

              6 Offline
              6 Offline
              6EQUJ5
              wrote on 18 Mar 2017, 23:52 last edited by
              #9

              @SGaist I created my QMediaPlayer object like this:

              ___QMediaPlayer *player = new QMediaPlayer(this);

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 18 Mar 2017, 23:58 last edited by
                #10

                What is this ?

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

                6 1 Reply Last reply 19 Mar 2017, 00:21
                0
                • S SGaist
                  18 Mar 2017, 23:58

                  What is this ?

                  6 Offline
                  6 Offline
                  6EQUJ5
                  wrote on 19 Mar 2017, 00:21 last edited by 6EQUJ5
                  #11

                  @SGaist this is MainWindow.

                  mainwindow.h

                  #ifndef MAINWINDOW_H
                  #define MAINWINDOW_H
                  
                  #include <QMainWindow>
                  #include <QtMultimedia/QMediaPlayer>
                  
                  namespace Ui
                  {
                      class MainWindow;
                  }
                  
                  class MainWindow : public QMainWindow
                  {
                      Q_OBJECT
                  
                  public:
                      explicit MainWindow(QWidget *parent = 0);
                      ~MainWindow();
                  
                  private:
                      QMediaPlayer *player = new QMediaPlayer(this);
                      Ui::MainWindow *ui;
                  };
                  
                  #endif // MAINWINDOW_H
                  
                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    KhoaTran Programmer
                    wrote on 19 Mar 2017, 01:04 last edited by
                    #12

                    @6EQUJ5 ,

                    Could you please try to run some media player that has already had in Qt package

                    Qt5.8.0\Examples\Qt-5.8\multimedia\video\qmlvideo
                    Qt5.8.0\Examples\Qt-5.8\multimediawidgets\player

                    You should ensure that the Multimedia backend is available on your system or not?

                    Best regards,
                    Khoa

                    6 1 Reply Last reply 19 Mar 2017, 01:23
                    0
                    • K KhoaTran Programmer
                      19 Mar 2017, 01:04

                      @6EQUJ5 ,

                      Could you please try to run some media player that has already had in Qt package

                      Qt5.8.0\Examples\Qt-5.8\multimedia\video\qmlvideo
                      Qt5.8.0\Examples\Qt-5.8\multimediawidgets\player

                      You should ensure that the Multimedia backend is available on your system or not?

                      Best regards,
                      Khoa

                      6 Offline
                      6 Offline
                      6EQUJ5
                      wrote on 19 Mar 2017, 01:23 last edited by 6EQUJ5
                      #13

                      @KhoaTran-Programmer With qmlvideo when I tried to play a video it logged me out again. With player it logged me out the moment I ran it.

                      Why do I get logged out when I try to run multimedia based Qt programs? And how do I ensure the multimedia back end is available on my system and install the multimedia backend?

                      K J 2 Replies Last reply 20 Mar 2017, 01:02
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 19 Mar 2017, 18:57 last edited by
                        #14

                        You should start by testing with your distribution provided Qt to ensure that everything is working correctly.

                        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
                        • 6 6EQUJ5
                          19 Mar 2017, 01:23

                          @KhoaTran-Programmer With qmlvideo when I tried to play a video it logged me out again. With player it logged me out the moment I ran it.

                          Why do I get logged out when I try to run multimedia based Qt programs? And how do I ensure the multimedia back end is available on my system and install the multimedia backend?

                          K Offline
                          K Offline
                          KhoaTran Programmer
                          wrote on 20 Mar 2017, 01:02 last edited by
                          #15

                          @6EQUJ5

                          How to ensure the multimedia backend is available or not? I try 2 methods before:

                          1. Use default application of Qt(qmlvideo, player, ...)
                            -> If one of them can run well, we can conclude it's OK
                          2. Download Qt everywhere package and install(I try on Linux Embedded)
                            -> When building Qt Multimedia component, qmake will automatically detect the backend, if it's not available some error info will display

                          For your information, multimedia backend is not same for each OS

                          • Windows: Directshow -> it's always available in Windows
                          • Linux: Gstreamer -> Most, if not all, Linux distributions provide packages of GStreamer. You should find these in your distribution's package repository.
                          • QNX: ???
                          • Android: StageFight(maybe)

                          Since your OS is Linux(Debian 8), so please confirm Gstreamer firstly. The fastest way, open termial and run some Gstreamer command line tools:
                          $ gst-inspect-1.0
                          $ gst-launch-1.0

                          For set up Gstreamer on Linux, please refer to:
                          https://gstreamer.freedesktop.org/documentation/installing/on-linux.html

                          Best regards,
                          Khoa

                          6 2 Replies Last reply 20 Mar 2017, 07:42
                          0
                          • 6 6EQUJ5
                            19 Mar 2017, 01:23

                            @KhoaTran-Programmer With qmlvideo when I tried to play a video it logged me out again. With player it logged me out the moment I ran it.

                            Why do I get logged out when I try to run multimedia based Qt programs? And how do I ensure the multimedia back end is available on my system and install the multimedia backend?

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 20 Mar 2017, 05:22 last edited by
                            #16

                            @6EQUJ5 Sounds like an issue with your graphics driver. Does any media player work?

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

                            1 Reply Last reply
                            0
                            • K KhoaTran Programmer
                              20 Mar 2017, 01:02

                              @6EQUJ5

                              How to ensure the multimedia backend is available or not? I try 2 methods before:

                              1. Use default application of Qt(qmlvideo, player, ...)
                                -> If one of them can run well, we can conclude it's OK
                              2. Download Qt everywhere package and install(I try on Linux Embedded)
                                -> When building Qt Multimedia component, qmake will automatically detect the backend, if it's not available some error info will display

                              For your information, multimedia backend is not same for each OS

                              • Windows: Directshow -> it's always available in Windows
                              • Linux: Gstreamer -> Most, if not all, Linux distributions provide packages of GStreamer. You should find these in your distribution's package repository.
                              • QNX: ???
                              • Android: StageFight(maybe)

                              Since your OS is Linux(Debian 8), so please confirm Gstreamer firstly. The fastest way, open termial and run some Gstreamer command line tools:
                              $ gst-inspect-1.0
                              $ gst-launch-1.0

                              For set up Gstreamer on Linux, please refer to:
                              https://gstreamer.freedesktop.org/documentation/installing/on-linux.html

                              Best regards,
                              Khoa

                              6 Offline
                              6 Offline
                              6EQUJ5
                              wrote on 20 Mar 2017, 07:42 last edited by
                              #17

                              @KhoaTran-Programmer On https://gstreamer.freedesktop.org/documentation/installing/on-linux.html the instructions for Debian installation is this:

                              Install GStreamre on Ubuntu or Debian
                              Run the following command:
                              
                              apt-get install ....
                              

                              Which I'm not sure about. I tried running sudo aptitude install gstreamer which didn't work. Then after typing in sudo aptitude install gstreamer and pressing TAB a bunch of packages came up which I don't know which to install.

                              Can you clarify how to install on Debian?

                              J 1 Reply Last reply 20 Mar 2017, 07:58
                              0
                              • 6 6EQUJ5
                                20 Mar 2017, 07:42

                                @KhoaTran-Programmer On https://gstreamer.freedesktop.org/documentation/installing/on-linux.html the instructions for Debian installation is this:

                                Install GStreamre on Ubuntu or Debian
                                Run the following command:
                                
                                apt-get install ....
                                

                                Which I'm not sure about. I tried running sudo aptitude install gstreamer which didn't work. Then after typing in sudo aptitude install gstreamer and pressing TAB a bunch of packages came up which I don't know which to install.

                                Can you clarify how to install on Debian?

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 20 Mar 2017, 07:58 last edited by
                                #18

                                @6EQUJ5 You should install all the GStreamer plug-in packages.
                                But I don't think it is related to the installed GStreamer packages: if something needed is missing you will not be able to play a media file, but you should not be logged off.

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

                                1 Reply Last reply
                                0
                                • K KhoaTran Programmer
                                  20 Mar 2017, 01:02

                                  @6EQUJ5

                                  How to ensure the multimedia backend is available or not? I try 2 methods before:

                                  1. Use default application of Qt(qmlvideo, player, ...)
                                    -> If one of them can run well, we can conclude it's OK
                                  2. Download Qt everywhere package and install(I try on Linux Embedded)
                                    -> When building Qt Multimedia component, qmake will automatically detect the backend, if it's not available some error info will display

                                  For your information, multimedia backend is not same for each OS

                                  • Windows: Directshow -> it's always available in Windows
                                  • Linux: Gstreamer -> Most, if not all, Linux distributions provide packages of GStreamer. You should find these in your distribution's package repository.
                                  • QNX: ???
                                  • Android: StageFight(maybe)

                                  Since your OS is Linux(Debian 8), so please confirm Gstreamer firstly. The fastest way, open termial and run some Gstreamer command line tools:
                                  $ gst-inspect-1.0
                                  $ gst-launch-1.0

                                  For set up Gstreamer on Linux, please refer to:
                                  https://gstreamer.freedesktop.org/documentation/installing/on-linux.html

                                  Best regards,
                                  Khoa

                                  6 Offline
                                  6 Offline
                                  6EQUJ5
                                  wrote on 20 Mar 2017, 09:44 last edited by 6EQUJ5
                                  #19

                                  @KhoaTran-Programmer The Gstreamer command line tools doesn't work (no such command exists according to terminal even with sudo). But, trying to install the Gstreamer plugins such as gstreamer1.0-plugins-base with sudo apt-get install gstreamer1.0-plugins-base tells me it's already installed.

                                  @jsulm What do you mean "any" media player? The examples on Qt or any media player that is installed? If you mean any old media player GNOME MPlayer works.

                                  @SGaist Aren't I doing that already? By using this version: Qt 5.8.0 for Linux 64-bit (766 MB)

                                  J 1 Reply Last reply 20 Mar 2017, 09:47
                                  0
                                  • 6 6EQUJ5
                                    20 Mar 2017, 09:44

                                    @KhoaTran-Programmer The Gstreamer command line tools doesn't work (no such command exists according to terminal even with sudo). But, trying to install the Gstreamer plugins such as gstreamer1.0-plugins-base with sudo apt-get install gstreamer1.0-plugins-base tells me it's already installed.

                                    @jsulm What do you mean "any" media player? The examples on Qt or any media player that is installed? If you mean any old media player GNOME MPlayer works.

                                    @SGaist Aren't I doing that already? By using this version: Qt 5.8.0 for Linux 64-bit (766 MB)

                                    J Offline
                                    J Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on 20 Mar 2017, 09:47 last edited by
                                    #20

                                    @6EQUJ5 Qt 5.8 is for sure not what Debian provides (maybe Unstable?), I guess you installed Qt 5.8 by yourself, right? What @SGaist means is: try with Qt provided by Debian.

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

                                    6 1 Reply Last reply 20 Mar 2017, 09:49
                                    0
                                    • J jsulm
                                      20 Mar 2017, 09:47

                                      @6EQUJ5 Qt 5.8 is for sure not what Debian provides (maybe Unstable?), I guess you installed Qt 5.8 by yourself, right? What @SGaist means is: try with Qt provided by Debian.

                                      6 Offline
                                      6 Offline
                                      6EQUJ5
                                      wrote on 20 Mar 2017, 09:49 last edited by 6EQUJ5
                                      #21

                                      @jsulm Where can I get that? And yes I download the offline installer for Qt 5.8.0 for Linux 64-bit (766 MB) and installed Qt.

                                      J 1 Reply Last reply 20 Mar 2017, 09:51
                                      0
                                      • 6 6EQUJ5
                                        20 Mar 2017, 09:49

                                        @jsulm Where can I get that? And yes I download the offline installer for Qt 5.8.0 for Linux 64-bit (766 MB) and installed Qt.

                                        J Offline
                                        J Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on 20 Mar 2017, 09:51 last edited by
                                        #22

                                        @6EQUJ5 From Debian? Use apt-get to install it as any other packages.
                                        What you downloaded is not what Debian provides.

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

                                        6 1 Reply Last reply 20 Mar 2017, 09:57
                                        1
                                        • J jsulm
                                          20 Mar 2017, 09:51

                                          @6EQUJ5 From Debian? Use apt-get to install it as any other packages.
                                          What you downloaded is not what Debian provides.

                                          6 Offline
                                          6 Offline
                                          6EQUJ5
                                          wrote on 20 Mar 2017, 09:57 last edited by
                                          #23

                                          @jsulm What packages do I install? Do I have to install them all separately like qtcreator, qtbase5-dev, etc. or is there a way to install it with one package? If not what are all the packages needed?

                                          J 1 Reply Last reply 20 Mar 2017, 10:00
                                          0

                                          13/65

                                          19 Mar 2017, 01:23

                                          52 unread
                                          • Login

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