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. GStreamer : Pipeline to connect VNC server and Display/Record the remote GUI
Forum Updated to NodeBB v4.3 + New Features

GStreamer : Pipeline to connect VNC server and Display/Record the remote GUI

Scheduled Pinned Locked Moved Solved General and Desktop
35 Posts 3 Posters 16.3k Views 1 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.
  • SGaistS SGaist

    Copies from this thread:

    A GStreamer pipeline is basically a list of module that you chain to each other from the source to the sink to, for example, read an audio file, decode it and finally send it to your audio output.

    From a command line point of view, it's the elements built from the parameters you give to gst-launch.

    For example:
    Play the mp3 music file "music.mp3" using a libmad-based plugin and output to an OSS device:

    gst-launch-1.0 filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! osssink
    

    The documentation of get-launch gives you more good examples.
    The API tutorials are pretty nice to get started.

    ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #3

    @SGaist said in GStreamer : understanding the concept of 'pipeline':

    Copies from this thread:

    Yes, thx, i did a new one because the other thread is turning to spaghetti.
    Thx for explanation, it is bit clearer
    I will dive into these docs today.

    1 Reply Last reply
    0
    • ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #4

      Hi,
      I'm testing the GStreamer Hello World exemple, a call to GstMessage * gst_bus_timed_pop_filtered() is underlined in red, and application cant compile
      Qt creator autocompletion can find it, but when i call it

      msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS)
      

      output : no matching function for call to 'gst_bus_timed_pop_filtered'

      What could be the problem please ?

      jsulmJ 1 Reply Last reply
      0
      • ODБOïO ODБOï

        Hi,
        I'm testing the GStreamer Hello World exemple, a call to GstMessage * gst_bus_timed_pop_filtered() is underlined in red, and application cant compile
        Qt creator autocompletion can find it, but when i call it

        msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS)
        

        output : no matching function for call to 'gst_bus_timed_pop_filtered'

        What could be the problem please ?

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

        @LeLev Header file not included?
        Wrong parameters passed?

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

        ODБOïO 1 Reply Last reply
        1
        • jsulmJ jsulm

          @LeLev Header file not included?
          Wrong parameters passed?

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by ODБOï
          #6

          @jsulm hi
          i only include <gst/gst.h>

          about parameters, i also tryed to compile the program without passing any parameters to gst_bus_timed_pop_filtered
          and had this output :
          too few arguments to function 'GstMessage* gst_bus_timed_pop_filtered(GstBus*, GstClockTime, GstMessageType)'
          msg = gst_bus_timed_pop_filtered();
          ^

          jsulmJ 1 Reply Last reply
          0
          • ODБOïO ODБOï

            @jsulm hi
            i only include <gst/gst.h>

            about parameters, i also tryed to compile the program without passing any parameters to gst_bus_timed_pop_filtered
            and had this output :
            too few arguments to function 'GstMessage* gst_bus_timed_pop_filtered(GstBus*, GstClockTime, GstMessageType)'
            msg = gst_bus_timed_pop_filtered();
            ^

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

            @LeLev said in GStreamer : understanding the concept of 'pipeline':

            without passing any parameters

            this will for sure not work as the function expects 3 parameters: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-timed-pop-filtered

            Can you post the whole error message with the parameters you were passing before?
            Maybe the type of "bus" was wrong?

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

            1 Reply Last reply
            0
            • ODБOïO Offline
              ODБOïO Offline
              ODБOï
              wrote on last edited by ODБOï
              #8

              @jsulm

                   gst_init (&argc, &argv);
                   GstElement *pipeline;
                   GstBus *bus;
                   GstMessage *msg;
              
                   pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
              
                     gst_element_set_state (pipeline, GST_STATE_PLAYING);
                     
                     bus = gst_element_get_bus (pipeline);
                     msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
              

              output :

              no matching function for call to 'gst_bus_timed_pop_filtered'
              
              erreur : invalid conversion from 'int' to 'GstMessageType' [-fpermissive]
                      msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
                                                                                 ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
              
              jsulmJ 1 Reply Last reply
              0
              • ODБOïO ODБOï

                @jsulm

                     gst_init (&argc, &argv);
                     GstElement *pipeline;
                     GstBus *bus;
                     GstMessage *msg;
                
                     pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
                
                       gst_element_set_state (pipeline, GST_STATE_PLAYING);
                       
                       bus = gst_element_get_bus (pipeline);
                       msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
                

                output :

                no matching function for call to 'gst_bus_timed_pop_filtered'
                
                erreur : invalid conversion from 'int' to 'GstMessageType' [-fpermissive]
                        msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
                                                                                   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #9

                @LeLev said in GStreamer : understanding the concept of 'pipeline':

                GST_MESSAGE_ERROR | GST_MESSAGE_EOS

                this is the actual problem. Try to cast it to GstMessageType:

                msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, static_cast<GstMessageType>(GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
                

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

                ODБOïO 1 Reply Last reply
                1
                • ODБOïO Offline
                  ODБOïO Offline
                  ODБOï
                  wrote on last edited by
                  #10

                  i just changed the 3rd parameter and it compiled

                  msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
                  
                  jsulmJ 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @LeLev said in GStreamer : understanding the concept of 'pipeline':

                    GST_MESSAGE_ERROR | GST_MESSAGE_EOS

                    this is the actual problem. Try to cast it to GstMessageType:

                    msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, static_cast<GstMessageType>(GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
                    
                    ODБOïO Offline
                    ODБOïO Offline
                    ODБOï
                    wrote on last edited by
                    #11

                    @jsulm said in GStreamer : understanding the concept of 'pipeline':

                    ry to cast it to GstMessageType:

                    Thank you !

                    1 Reply Last reply
                    0
                    • ODБOïO ODБOï

                      i just changed the 3rd parameter and it compiled

                      msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
                      
                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #12

                      @LeLev That's why it is important to post all errors: many errors are just follow up errors caused by another error.

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

                      ODБOïO 1 Reply Last reply
                      1
                      • jsulmJ jsulm

                        @LeLev That's why it is important to post all errors: many errors are just follow up errors caused by another error.

                        ODБOïO Offline
                        ODБOïO Offline
                        ODБOï
                        wrote on last edited by ODБOï
                        #13

                        @jsulm said in GStreamer : understanding the concept of 'pipeline':

                        all errors

                        saved for the next time.

                        I'm confused about this lib.
                        In this hello world exemple they say :

                        If everything built fine, fire up the executable! You should see a window pop up, containing a video being played straight from the Internet, along with audio. Congratulations!

                        I can't figure out how a window will pop up.
                        I'm reading the playbin description right now, in my app nothing pops up.

                        jsulmJ 1 Reply Last reply
                        0
                        • ODБOïO ODБOï

                          @jsulm said in GStreamer : understanding the concept of 'pipeline':

                          all errors

                          saved for the next time.

                          I'm confused about this lib.
                          In this hello world exemple they say :

                          If everything built fine, fire up the executable! You should see a window pop up, containing a video being played straight from the Internet, along with audio. Congratulations!

                          I can't figure out how a window will pop up.
                          I'm reading the playbin description right now, in my app nothing pops up.

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

                          @LeLev said in GStreamer : understanding the concept of 'pipeline':

                          I can't figure out how a window will pop up.

                          So, you start the app but no window pops up?
                          Then probably something is wrong. I don't know what. You can debug and see what happens.

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

                          ODБOïO 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @LeLev said in GStreamer : understanding the concept of 'pipeline':

                            I can't figure out how a window will pop up.

                            So, you start the app but no window pops up?
                            Then probably something is wrong. I don't know what. You can debug and see what happens.

                            ODБOïO Offline
                            ODБOïO Offline
                            ODБOï
                            wrote on last edited by ODБOï
                            #15

                            @jsulm said in GStreamer : understanding the concept of 'pipeline':

                            So, you start the app but no window pops up?

                            Yes,

                            @jsulm said in GStreamer : understanding the concept of 'pipeline':

                            probably something is wrong

                            yes, with putenv("GST_DEBUG=2"); i got :

                            0:00:03.253981299  1536 0000000037E010C0 WARN             souphttpsrc gstsouphttpsrc.c:1379:gst_soup_http_src_parse_status:<source> error: Secure connection setup failed.
                            0:00:03.254006642  1536 0000000037E010C0 WARN             souphttpsrc gstsouphttpsrc.c:1379:gst_soup_http_src_parse_status:<source> error: TLS/SSL support not available; install glib-networking (6), URL: https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm, Redirect to: (NULL)
                            0:00:03.254067912  1536 0000000037E010C0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<source> error: Internal data stream error.
                            0:00:03.254105765  1536 0000000037E010C0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<source> error: streaming stopped, reason error (-5)
                            0:00:03.254180509  1536 0000000037E010C0 WARN                typefind gsttypefindelement.c:991:gst_type_find_element_chain_do_typefinding:<typefindelement0> error: Stream doesn't contain enough data.
                            0:00:03.254192057  1536 0000000037E010C0 WARN                typefind gsttypefindelement.c:991:gst_type_find_element_chain_do_typefinding:<typefindelement0> error: Can't typefind stream
                            

                            i will install glib-networking

                            jsulmJ 1 Reply Last reply
                            0
                            • ODБOïO ODБOï

                              @jsulm said in GStreamer : understanding the concept of 'pipeline':

                              So, you start the app but no window pops up?

                              Yes,

                              @jsulm said in GStreamer : understanding the concept of 'pipeline':

                              probably something is wrong

                              yes, with putenv("GST_DEBUG=2"); i got :

                              0:00:03.253981299  1536 0000000037E010C0 WARN             souphttpsrc gstsouphttpsrc.c:1379:gst_soup_http_src_parse_status:<source> error: Secure connection setup failed.
                              0:00:03.254006642  1536 0000000037E010C0 WARN             souphttpsrc gstsouphttpsrc.c:1379:gst_soup_http_src_parse_status:<source> error: TLS/SSL support not available; install glib-networking (6), URL: https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm, Redirect to: (NULL)
                              0:00:03.254067912  1536 0000000037E010C0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<source> error: Internal data stream error.
                              0:00:03.254105765  1536 0000000037E010C0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<source> error: streaming stopped, reason error (-5)
                              0:00:03.254180509  1536 0000000037E010C0 WARN                typefind gsttypefindelement.c:991:gst_type_find_element_chain_do_typefinding:<typefindelement0> error: Stream doesn't contain enough data.
                              0:00:03.254192057  1536 0000000037E010C0 WARN                typefind gsttypefindelement.c:991:gst_type_find_element_chain_do_typefinding:<typefindelement0> error: Can't typefind stream
                              

                              i will install glib-networking

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

                              @LeLev You could try to play a video from a non-SSL (non-HTTPS) URL.

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

                              ODБOïO 1 Reply Last reply
                              1
                              • jsulmJ jsulm

                                @LeLev You could try to play a video from a non-SSL (non-HTTPS) URL.

                                ODБOïO Offline
                                ODБOïO Offline
                                ODБOï
                                wrote on last edited by
                                #17

                                @jsulm That worked thank you!

                                ODБOïO 1 Reply Last reply
                                0
                                • ODБOïO ODБOï

                                  @jsulm That worked thank you!

                                  ODБOïO Offline
                                  ODБOïO Offline
                                  ODБOï
                                  wrote on last edited by
                                  #18

                                  Can please someone help me to complete this pipeline so it can record the VNC remote desktop to video file and/or show it with
                                  playbin ?
                                  pipeline = gst_parse_launch("rfbsrc host=xx.xx.xx.xx port=5900 password=passw view-only=true",NULL);

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

                                    Use the tee plugin.

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

                                    ODБOïO 1 Reply Last reply
                                    1
                                    • SGaistS SGaist

                                      Use the tee plugin.

                                      ODБOïO Offline
                                      ODБOïO Offline
                                      ODБOï
                                      wrote on last edited by ODБOï
                                      #20

                                      @SGaist thank you, I tryed to use tee, but that is more complicated to do, i actually don't want to Watch and Save/record.
                                      I would like to only save the video without displaying it.

                                      after some houres i got this broken pipeline..

                                      I have lot of troubles on how to set up the format for the video and write it to a file
                                      I use ultraVnc server

                                      "rfbsrc host=xx.xx.xx.xx port=5900 password=pw view-only=true   TODO : set up video format    ! mpegtsmux ! filesink location=testvideo.mp4"
                                      

                                      i have this output

                                      ** (QVNCClient.exe:10252): CRITICAL **: gst_video_info_set_format: assertion 'format != GST_VIDEO_FORMAT_UNKNOWN' failed
                                      
                                      ** (QVNCClient.exe:10252): CRITICAL **: gst_video_info_to_caps: assertion 'info->finfo->format != GST_VIDEO_FORMAT_UNKNOWN' failed
                                      
                                      (QVNCClient.exe:10252): GStreamer-CRITICAL **: gst_event_new_caps: assertion 'caps != NULL' failed
                                      
                                      (QVNCClient.exe:10252): GStreamer-CRITICAL **: gst_pad_push_event: assertion 'GST_IS_EVENT (event)' failed
                                      
                                      (QVNCClient.exe:10252): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
                                      0:00:00.737522311 10252 0000000036FDDBC0 WARN                 basesrc gstbasesrc.c:3275:gst_base_src_prepare_allocation:<rfbsrc0> Subclass failed to decide allocation
                                      0:00:00.737604753 10252 0000000036FDDBC0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<rfbsrc0> error: Internal data stream error.
                                      0:00:00.737644531 10252 0000000036FDDBC0 WARN                 basesrc gstbasesrc.c:3055:gst_base_src_loop:<rfbsrc0> error: streaming stopped, reason not-negotiated (-4)
                                      This program is linked against GStreamer 1.14.3 
                                      

                                      THX

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

                                        You have here an example of pipeline with h264 recording.

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

                                        ODБOïO 1 Reply Last reply
                                        1
                                        • SGaistS SGaist

                                          You have here an example of pipeline with h264 recording.

                                          ODБOïO Offline
                                          ODБOïO Offline
                                          ODБOï
                                          wrote on last edited by ODБOï
                                          #22

                                          @SGaist hi,
                                          I am still struggling with Gstreamer.

                                          Could you please try to see where the probleme is ?
                                          i try this pipeline :

                                          gst-launch-1.0 -v rfbsrc host=xx.xx.x.xx port=5900 password=passw view-only=true !
                                          tee name = t ! queue ! omxh264enc ! 
                                          'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! 
                                          filesink location=test.mp4 t. ! queue ! videoscale ! video/x-raw, 
                                          width=480,height=270 ! xvimagesink -e sync=false
                                          

                                          OUTPUT :
                                          *(gst-launch-1.0:8672): GStreamer-CRITICAL *: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
                                          WARNING: erroneous pipeline: no element "omxh264enc"

                                          I downloaded and installed x264 from here but i still get same error

                                          Maybe there is a simple way to just connect to VNC srv and only record without displaying.
                                          Or a simple tool that i can start with QProcess

                                          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