Solved GStreamer : Pipeline to connect VNC server and Display/Record the remote GUI
-
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
-
You have here an example of pipeline with h264 recording.
-
@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 -
i tryed like this also :
gst-launch-1.0 rfbsrc host=xx.x.x.xx port=xxxx password=xxxx view-only=true ! videoconvert ! x264enc ! flvmux ! filesink location=xyz.flv
OUTPUT : WARNING : erroneous pipeline : no element "x264enc"
I found "x264enc" is part of gst-plugins-ugly but cant fugure out how to install tath missing plugin. I downloaded it from here
I also found a tool : vnc2flv
i need to build it with python but when i try i get :error print version
Missing parentheses in call to 'print'. Did you mean print(version)