@JoeCFD @JoeCFD
I have found an Issue! I have used a port 5000 which is blocked on my machine, but only if the request comes not from terminal (No Idea how could it be... :) ).
To find it I have used the native approach:
#include <gst/video/videooverlay.h>
#include <gst/gst.h>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
gst_init(NULL,NULL);
// getting more information
gst_debug_set_active(true);
gst_debug_set_default_threshold(GST_LEVEL_INFO);
GstElement *pipelineVideoIn = nullptr;
GstStateChangeReturn ret;
GstElement *source = nullptr;
GstElement *capsfilter = nullptr;
GstElement *rtpjpegdepay = nullptr;
GstElement *jpegdec = nullptr;
GstElement *videoconvert = nullptr;
GstElement *sink = nullptr;
GstCaps *caps;
pipelineVideoIn = gst_pipeline_new("pipeline");
source = gst_element_factory_make("udpsrc", "source");
capsfilter = gst_element_factory_make("capsfilter", "capsfilter");
rtpjpegdepay = gst_element_factory_make("rtpjpegdepay", "rtpjpegdepay");
jpegdec = gst_element_factory_make("jpegdec", "jpegdec");
videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
sink = gst_element_factory_make("qtvideosink", "sink");
gst_bin_add_many(GST_BIN(pipelineVideoIn),
source, capsfilter, rtpjpegdepay,
jpegdec, videoconvert, sink, nullptr);
if (!gst_element_link_many(source, capsfilter, rtpjpegdepay, jpegdec, videoconvert, sink, nullptr)) {
g_printerr("Elements could not be linked");
}
g_object_set(source, "port", 5000, nullptr);
caps = gst_caps_from_string("application/x-rtp, media=video, clock-rate=90000, encoding-name=JPEG, payload=96");
g_object_set(capsfilter, "caps", caps, nullptr);
gst_caps_unref(caps);
// get window handle
WId xwinid = ui->videoWidget->winId();
// try to set overlay
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink), xwinid);
GstStateChangeReturn sret = gst_element_set_state (pipelineVideoIn, GST_STATE_PLAYING);
}
Unfortunately has this code an another problem, the overlay cannot be set :( and program crushes. But due to gst debug features, it is clear, that the gstreamer cannot connect the given address, because it is "already in use"
[image: 551b6863-3000-4f35-8f29-96c748d73c94.png]
And after changing of the port on both sides (source and sink), streaming start to work with old application!
Ones Again, Thanks @JoeCFD for your Advice's!