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. Unable to use Qt Multimedia in Qt 5.6.3 on Ubuntu 20.04.6 LTS: "No service found for - org.qt-project.qt.mediaplayer"

Unable to use Qt Multimedia in Qt 5.6.3 on Ubuntu 20.04.6 LTS: "No service found for - org.qt-project.qt.mediaplayer"

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qt5.6qmllinuxubuntu 20.04mediaplayer
8 Posts 2 Posters 1.5k Views
  • 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 Offline
    A Offline
    Animesh452
    wrote on 4 Oct 2023, 09:35 last edited by
    #1

    I'm new to Qt, and I'm currently using version 5.6.3 on Ubuntu 20.04.6 LTS. Due to reasons, I cannot upgrade to a newer version of Qt. I'm building a video player and trying to use the Qt Multimedia module, but I'm encountering the following error:

    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    

    I am trying to run the following code:

    import QtQuick 2.5
    import QtMultimedia 5.6
    import QtQuick.Controls 2.0
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: "Video Player"
    
        MediaPlayer {
            id: mediaPlayer
            source: "file:///path/to/your/video.mp4"
            autoPlay: false
        }
    
        VideoOutput {
            id: videoOutput
            anchors.fill: parent
            source: mediaPlayer
            fillMode: VideoOutput.PreserveAspectFit
        }
    
        Slider {
            id: slider
            width: parent.width
            maximumValue: mediaPlayer.duration
            value: mediaPlayer.position
            onValueChanged: {
                if (!slider.isPressed) {
                    return;
                }
                mediaPlayer.position = slider.value;
            }
        }
    
        Row {
            id: controls
            anchors.bottom: parent.bottom
            spacing: 10
            Button {
                id: playButton
                text: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "Pause" : "Play"
                onClicked: {
                    if (mediaPlayer.playbackState === MediaPlayer.PlayingState) {
                        mediaPlayer.pause();
                    } else {
                        mediaPlayer.play();
                    }
                }
            }
            Button {
                text: "Stop"
                onClicked: mediaPlayer.stop()
            }
        }
    }
    

    I've tried several things to resolve this issue:

    I checked the output of ldd libgstmediaplayer.so and found that the system is unable to find the GStreamer 0.10 libraries. However, I have GStreamer 1.x installed on my system, as confirmed by the output of gst-inspect-1.0.

    I tried to install GStreamer 0.10 using the following command, but the packages were not found: sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

    I attempted to rebuild Qt 5.6 with GStreamer 1.x support. I downloaded the Qt 5.6 source code, installed the necessary dependencies, set the PKG_CONFIG_PATH environment variable, and ran the configure script with the -gstreamer 1.0 option. However, I encountered an error saying that /home/user/qt-everywhere-opensource-src-5.6.3/qtbase/configure was not found.

    I'm at a loss for what to do next. Any help would be greatly appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Oct 2023, 18:34 last edited by
      #2

      Hi,

      You should start with a fresh source tree. If configure is not there then there's an issue with.

      I would also recommend using an out of source build so if something goes wrong you can just start from fresh more easily.

      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 5 Oct 2023, 05:45
      0
      • S SGaist
        4 Oct 2023, 18:34

        Hi,

        You should start with a fresh source tree. If configure is not there then there's an issue with.

        I would also recommend using an out of source build so if something goes wrong you can just start from fresh more easily.

        A Offline
        A Offline
        Animesh452
        wrote on 5 Oct 2023, 05:45 last edited by
        #3

        @SGaist Umm I am a beginner and am not exactly sure what you want me to do. From what I understand, a fresh source tree is making a new project. And I haven't done anything related to out of source builds. So, would you please elaborate?

        S 1 Reply Last reply 5 Oct 2023, 19:37
        0
        • A Animesh452
          5 Oct 2023, 05:45

          @SGaist Umm I am a beginner and am not exactly sure what you want me to do. From what I understand, a fresh source tree is making a new project. And I haven't done anything related to out of source builds. So, would you please elaborate?

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Oct 2023, 19:37 last edited by
          #4

          I meant with regards to your build of Qt 5.6. Grab the sources anew and redo the build steps from a freshly decompressed source tree.

          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 11 Oct 2023, 05:46
          0
          • S SGaist
            5 Oct 2023, 19:37

            I meant with regards to your build of Qt 5.6. Grab the sources anew and redo the build steps from a freshly decompressed source tree.

            A Offline
            A Offline
            Animesh452
            wrote on 11 Oct 2023, 05:46 last edited by
            #5

            @SGaist Hey, I tried this, but it didn't work. Some of my colleagues mentioned it is a license problem. So, is that true?

            Also, I tried this in Windows using the 5.6.3 MinGW build, and it worked fine. I am guessing the best way would be to upgrade the Qt version for Ubuntu, or is there any other way I can try?

            S 1 Reply Last reply 11 Oct 2023, 10:43
            0
            • A Animesh452
              11 Oct 2023, 05:46

              @SGaist Hey, I tried this, but it didn't work. Some of my colleagues mentioned it is a license problem. So, is that true?

              Also, I tried this in Windows using the 5.6.3 MinGW build, and it worked fine. I am guessing the best way would be to upgrade the Qt version for Ubuntu, or is there any other way I can try?

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 11 Oct 2023, 10:43 last edited by
              #6

              There's no particular license required to use the QtMultimedia module. It's likely a detection issue at configuration time. Do you have the GStreamer development packages installed ?

              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 16 Oct 2023, 06:53
              0
              • S SGaist
                11 Oct 2023, 10:43

                There's no particular license required to use the QtMultimedia module. It's likely a detection issue at configuration time. Do you have the GStreamer development packages installed ?

                A Offline
                A Offline
                Animesh452
                wrote on 16 Oct 2023, 06:53 last edited by
                #7

                @SGaist I have gstreamer 1.x but from what I found, qt 5.6 requires 0.1 which has become obsolete for linux 20.04. I tried installing it using deb package but encountered a couple of errors.

                S 1 Reply Last reply 16 Oct 2023, 20:29
                0
                • A Animesh452
                  16 Oct 2023, 06:53

                  @SGaist I have gstreamer 1.x but from what I found, qt 5.6 requires 0.1 which has become obsolete for linux 20.04. I tried installing it using deb package but encountered a couple of errors.

                  S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 16 Oct 2023, 20:29 last edited by
                  #8

                  One possible alternative could be to use a Docker container to build your application with a suitably old Ubuntu or maybe a VM which would be even simpler,

                  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

                  2/8

                  4 Oct 2023, 18:34

                  6 unread
                  • Login

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