Solved GStreamer : Pipeline to connect VNC server and Display/Record the remote GUI
-
Hi,
I want to use GStreamer to connect to a VNC server and record the video.
for now all i did is : I likned my app against GStreamerPlease someone explain or provide an introduction (simple) tutorial to help me to understand the concept of pipeline.
i need to use gst-launch-1.0 tool to create the pipeline and GstParse to generate and execute the pipeline in my code.Thank you in advance
-
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. -
@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. -
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 itmsg = 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 ?
-
@LeLev Header file not included?
Wrong parameters passed? -
@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();
^ -
@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? -
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); ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
-
@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));
-
i just changed the 3rd parameter and it compiled
msg = gst_bus_timed_pop_filtered(bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
-
@jsulm said in GStreamer : understanding the concept of 'pipeline':
ry to cast it to GstMessageType:
Thank you !
-
@LeLev That's why it is important to post all errors: many errors are just follow up errors caused by another error.
-
@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. -
@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. -
@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
-
@LeLev You could try to play a video from a non-SSL (non-HTTPS) URL.
-
@jsulm That worked thank you!
-
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); -
Use the tee plugin.
-
@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