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. QML MediaPlayer. Custom source for gst-pipeline
Forum Updated to NodeBB v4.3 + New Features

QML MediaPlayer. Custom source for gst-pipeline

Scheduled Pinned Locked Moved Unsolved General and Desktop
20 Posts 4 Posters 4.4k 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.
  • B Offline
    B Offline
    BrMisha
    wrote on 2 Jul 2021, 23:34 last edited by
    #1

    Hello!
    I'm using that component to play live-stream from some specific camera. At current time i use next source:

        MediaPlayer {
            source: "gst-pipeline: udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
            autoPlay: true
        }
    

    That works OK but in real life need to play from some c++ class which receives stream.
    How can i implement that? May be, I need to make custom gst source?
    Thanks)))

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Jul 2021, 22:06 last edited by
      #2

      Hi,

      What you are asking is not clear.

      Do you want to use a custom pipeline in C++ ?

      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
      • M Offline
        M Offline
        Ms.J
        wrote on 21 Aug 2021, 14:07 last edited by Ms.J
        #3

        @SGaist
        Hi,
        I want to receive udp live stream in qml application (ubuntu and android). Is it possible? like in vlc (udp://@:7777)
        i receive rtsp with MediaPlayer item correctly, but with udp i get error as below:
        Error: " udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink" : "no element "udpsrc""
        with this code:
        MediaPlayer {
        id: player
        source: "gst-pipeline: udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
        autoPlay: true
        }
        Any advice is greatly appreciated. Thank you so much!

        S 1 Reply Last reply 21 Aug 2021, 17:41
        0
        • M Ms.J
          21 Aug 2021, 14:07

          @SGaist
          Hi,
          I want to receive udp live stream in qml application (ubuntu and android). Is it possible? like in vlc (udp://@:7777)
          i receive rtsp with MediaPlayer item correctly, but with udp i get error as below:
          Error: " udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink" : "no element "udpsrc""
          with this code:
          MediaPlayer {
          id: player
          source: "gst-pipeline: udpsrc port=7777 ! h264parse ! avdec_h264 ! videoconvert ! qtvideosink"
          autoPlay: true
          }
          Any advice is greatly appreciated. Thank you so much!

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 21 Aug 2021, 17:41 last edited by
          #4

          @Ms-J hi and welcome to devnet,

          Do you have the required GStreamer plugin package installed ?

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

          M S 2 Replies Last reply 22 Aug 2021, 11:37
          0
          • S SGaist
            21 Aug 2021, 17:41

            @Ms-J hi and welcome to devnet,

            Do you have the required GStreamer plugin package installed ?

            M Offline
            M Offline
            Ms.J
            wrote on 22 Aug 2021, 11:37 last edited by Ms.J
            #5

            @SGaist hi and thanks to reply.
            I checked and installed gstreamer on ubuntu. i don't know how to install gstreamer on android?
            now on ubuntu i receive udp stream but screen is green and corrupted! maybe it's for bad pipelines.
            sometimes i receive Warning: "Pipeline construction is invalid, please add queues."
            Has any way to receive udp real time stream with high quality?
            Is QtGStreamer necessary to import? or we can get good quality with MediaPlayer item?
            thanks.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 22 Aug 2021, 18:18 last edited by
              #6

              On android you will have to build it yourself. There are instructions on the GStreamer site for that if memory serves well.

              QtGStreamer bindings have been deprecated and unmaintained since a long time. They have replaced them with the qmlgl plugin.

              As for your pipeline issue, the message is giving suggestions on how to fix it.

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

              M 2 Replies Last reply 23 Aug 2021, 07:56
              1
              • S SGaist
                22 Aug 2021, 18:18

                On android you will have to build it yourself. There are instructions on the GStreamer site for that if memory serves well.

                QtGStreamer bindings have been deprecated and unmaintained since a long time. They have replaced them with the qmlgl plugin.

                As for your pipeline issue, the message is giving suggestions on how to fix it.

                M Offline
                M Offline
                Ms.J
                wrote on 23 Aug 2021, 07:56 last edited by
                #7

                @SGaist thankyou for your response
                which massage? could you give me some suggestions about gstreamer pipelines in qml or documents that cover it?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 23 Aug 2021, 20:03 last edited by
                  #8

                  That message:

                  @Ms-J said in QML MediaPlayer. Custom source for gst-pipeline:

                  Warning: "Pipeline construction is invalid, please add queues."

                  Does your pipeline work properly on the command line ?

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

                  M 1 Reply Last reply 25 Aug 2021, 11:48
                  0
                  • S SGaist
                    23 Aug 2021, 20:03

                    That message:

                    @Ms-J said in QML MediaPlayer. Custom source for gst-pipeline:

                    Warning: "Pipeline construction is invalid, please add queues."

                    Does your pipeline work properly on the command line ?

                    M Offline
                    M Offline
                    Ms.J
                    wrote on 25 Aug 2021, 11:48 last edited by
                    #9

                    @SGaist I got the same corrupted video from command line :(
                    this is my command "gst-pipeline: udpsrc port=5000 ! h264parse ! avdec_h264 ! videoconvert ! autovideosink" for receive camera streamer. i searched and nothing helpfull found for that.
                    command line message:
                    Not enough buffering available for the processing deadline of 0:00:00.015000000, add enough queues to buffer 0:00:00.015000000 additional data. Shortening processing latency to 0:00:00.000000000.
                    any suggestion to improve pipelines for better preview?
                    thank you in advance.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 25 Aug 2021, 18:21 last edited by
                      #10

                      Add debugging to your pipeline, it may give you some more information about what is going on.

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

                      M 1 Reply Last reply 29 Aug 2021, 12:29
                      0
                      • S SGaist
                        25 Aug 2021, 18:21

                        Add debugging to your pipeline, it may give you some more information about what is going on.

                        M Offline
                        M Offline
                        Ms.J
                        wrote on 29 Aug 2021, 12:29 last edited by
                        #11

                        @SGaist Is it possible to receive stream in qml by FFMPEG decoder? like this command: ffplay udp://127.0.0.1:5000?
                        decoding in qt is software decode or hardware decode? how to know it?

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 29 Aug 2021, 17:51 last edited by
                          #12

                          You can check the QtAV project.

                          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
                          • S SGaist
                            22 Aug 2021, 18:18

                            On android you will have to build it yourself. There are instructions on the GStreamer site for that if memory serves well.

                            QtGStreamer bindings have been deprecated and unmaintained since a long time. They have replaced them with the qmlgl plugin.

                            As for your pipeline issue, the message is giving suggestions on how to fix it.

                            M Offline
                            M Offline
                            Ms.J
                            wrote on 6 Sept 2021, 05:36 last edited by
                            #13

                            @SGaist for android i could find gstreamer binary file for that ( https://gstreamer.freedesktop.org/download/ ) but i dont know how to add that libraries (libraries path) to project (in cmakelist or ?).
                            thank you so much.

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 6 Sept 2021, 19:09 last edited by
                              #14

                              Did you already check the android platform notes for GStreamer ?

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

                              M 1 Reply Last reply 7 Sept 2021, 07:57
                              0
                              • S SGaist
                                6 Sept 2021, 19:09

                                Did you already check the android platform notes for GStreamer ?

                                M Offline
                                M Offline
                                Ms.J
                                wrote on 7 Sept 2021, 07:57 last edited by Ms.J 9 Jul 2021, 13:10
                                #15

                                @SGaist yes i checked it.
                                i installed gstreamer-1.0 in my ubuntu and download video/android/gstreamer example.
                                when i want to build it for android (on ubuntu) i get following errors: :((

                                Project ERROR: Unknown module(s) in QT: multimediagsttools-private
                                [Inexact] Project ERROR: Library 'libresourceqt5' is not defined.
                                main.cpp:82:5: error: use of undeclared identifier 'QGstUtils'
                                main.cpp:54:10: error: 'private/qgstutils_p.h' file not found.

                                same problem: https://forum.qt.io/topic/122140/unknown-module-s-in-qt-multimediagsttools-private

                                Any advice is greatly appreciated.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  Ms.J
                                  wrote on 7 Sept 2021, 13:17 last edited by Ms.J 9 Jul 2021, 13:17
                                  #16

                                  for having gstreamer on android device, is it necessary to build Qt on ubuntu (for some config) or build gstreamer for android (how?)?
                                  "gst-pipeline: videotestsrc ! autovideosink" worked on ubuntu.

                                  thanks for your help.

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 7 Sept 2021, 18:51 last edited by
                                    #17

                                    As the platform notes says, to use the GStreamer backend on Androïd, you have to build the module yourself.

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

                                    M 1 Reply Last reply 8 Sept 2021, 14:23
                                    0
                                    • S SGaist
                                      7 Sept 2021, 18:51

                                      As the platform notes says, to use the GStreamer backend on Androïd, you have to build the module yourself.

                                      M Offline
                                      M Offline
                                      Ms.J
                                      wrote on 8 Sept 2021, 14:23 last edited by Ms.J 9 Aug 2021, 14:24
                                      #18

                                      @SGaist which module? where to get start? how to build gstreamer for android?
                                      i'm new in Qt. please give me steps.
                                      thanks a lot.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on 8 Sept 2021, 21:21 last edited by
                                        #19

                                        At least the Qt multimedia module. You can already find pre-built versions of GStreamer for Androïd AFAIR.

                                        I haven't built QtMultimedia to enable GStreamer for Androïd, but the basic are usually the same, use qmake, make, make install.

                                        I would recommend backing up your current installation if something goes wrong.

                                        And use out of source builds so you can experiment 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

                                        1 Reply Last reply
                                        0
                                        • S SGaist
                                          21 Aug 2021, 17:41

                                          @Ms-J hi and welcome to devnet,

                                          Do you have the required GStreamer plugin package installed ?

                                          S Offline
                                          S Offline
                                          samup
                                          wrote on 27 Mar 2023, 12:57 last edited by
                                          #20

                                          @SGaist Hello, could you refer me to this Gstreamer plugin package?

                                          I'm trying the following qml:

                                          MediaPlayer{
                                              id: playVideo
                                              source: "gst-pipeline: videotestsrc ! autovideosink"
                                              videoOutput: videoOutput
                                          }
                                          
                                          VideoOutput{
                                              id: videoOutput
                                              anchors.fill: parent
                                          }
                                          

                                          But as soon as the component is loaded I get this message:
                                          qt.multimedia.player: Unable to set the pipeline to the paused state.

                                          And I cannot visualize the pipeline. I tried using a generic video as source in the MediaPlayer component instead of a pipeline and it works.

                                          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