No subject

Sulthan Amanu sulthan4380 at gmail.com
Wed Aug 2 16:55:16 UTC 2023


Dear Team,

I hope this message finds you well. We have encountered an issue while
attempting to stream the buffer from an rtsp location using a C++ code.
Specifically, we are facing difficulties linking the rtspsrc and
rtph265depay elements in the pipeline. We would greatly appreciate your
assistance in resolving this matter.

Here are the details of the problem: Issue Description: We have a C++ code
responsible for handling buffer streaming from an rtsp location. The
pipeline consists of the rtspsrc element, which is intended to fetch data
from the rtsp location, and the rtph265depay element, which is meant to
handle the H.265 encoded data. However, despite our efforts, these elements
are unable to link properly, resulting in the failure of buffer streaming
Raw Pipeline - working fine gst-launch-1.0 rtspsrc location = rtsp://
192.168.1.10:5005/routecam latency = 0 ! rtph265depay ! h265parse !
d3d11h265dec ! d3d11videosink name= D3D11Renderer C++ code had a linking
issue

gst-launch-1.0 rtspsrc location = rtsp://192.168.1.10:5005/routecam latency
= 0 ! rtph265depay ! h265parse ! d3d11h265dec ! d3d11videosink name=
D3D11Renderer



        GstElement* source = gst_element_factory_make("rtspsrc", "source");

        GstElement* depay = NULL;
        GstElement* decoder = NULL;
        GstElement* parse = NULL;
        GstElement* fps_sink = gst_element_factory_make("fpsdisplaysink",
"fps_sink");
        GstElement* videoconvert = gst_element_factory_make("videoconvert",
"videoconvert");
        GstElement* videoscale = gst_element_factory_make("videoscale",
"videoscale");
        GstElement* Renderer = gst_element_factory_make("d3d11videosink",
"D3D11Renderer");





        if (format == "HEVC") {
            parse = gst_element_factory_make("h265parse", "parse");
            depay = gst_element_factory_make("rtph265depay", "depay");
            decoder = gst_element_factory_make("d3d11h265dec", "decoder");
        }
        else if (format == "H264") {
            parse = gst_element_factory_make("h264parse", "parse");
            depay = gst_element_factory_make("rtph264depay", "depay");
            decoder = gst_element_factory_make("d3d11h264dec", "decoder");
        }
        else if (format == "MJPG") {
            depay = gst_element_factory_make("decodebin", "depay");
        }
        else {
            cout << "Format is not valid";
            return false;
        }



        if (!source || !depay || !parse || !decoder || !Renderer) {
            g_printerr("Not all elements could be created.\n");
            return false;
        }



        GstElement* pipeline = gst_pipeline_new("rtsp-pipeline");
        if (!pipeline) {
            g_printerr("Pipeline could not be created.\n");
            return false;
        }



        g_object_set(G_OBJECT(source), "location", s.c_str(), NULL);



        g_object_set(G_OBJECT(source), "latency", 0, NULL);



        gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, decoder,
Renderer, NULL);



        if (!gst_element_link(source, depay)) {
            g_printerr("Elements could not be linked.\n");
            gst_object_unref(pipeline);
        }



        if (!gst_element_link(depay, parse)) {
            g_printerr("Elements could not be linked.\n");
            gst_object_unref(pipeline);
        }



        if (!gst_element_link(parse, decoder)) {
            g_printerr("Elements could not be linked.\n");
            gst_object_unref(pipeline);
        }



        if (!gst_element_link(decoder, Renderer)) {
            g_printerr("Elements could not be linked.\n");
            gst_object_unref(pipeline);
        }



        /*if (!gst_element_link_many(source, depay, parse, decoder,
Renderer, NULL)) {
            g_printerr("Elements could not be linked.\n");
            gst_object_unref(pipeline);
            return false;
        }*/



        // Setting the window handle to renderer
        GstElement* d3d11_renderer = gst_bin_get_by_name(GST_BIN(pipeline),
"d3d11videosink");

gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(d3d11_renderer),
(guintptr)Windowhandle);

Regards, Sulthan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230802/fccd3257/attachment.htm>


More information about the gstreamer-devel mailing list