Deepstream-c nvurisrcbin is unable to receive RTSP streams from H265

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) :GPU
• DeepStream Version :DeepStream-6.1.1
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) :questions
I use nvurisrcbin to receive the H265 format RTSP stream, and use GST_deBUG=3 to display
error info:

rtph265depth gstrtph265depth. c: 1310: gst_rtp_h265_depay_process: Assuming DONL field is not present

Subsequently, my program reported a segment error

The code I am using:

static void cb_newpad(GstElement *decodebin, GstPad *decoder_src_pad, gpointer data)
{
    GstCaps *caps = gst_pad_get_current_caps(decoder_src_pad);
    if (!caps)
    {
        caps = gst_pad_query_caps(decoder_src_pad, NULL);
    }
    const GstStructure *str = gst_caps_get_structure(caps, 0);
    const gchar *name = gst_structure_get_name(str);
    GstElement *source_bin = (GstElement *)data;
    GstCapsFeatures *features = gst_caps_get_features(caps, 0);

    if (!strncmp(name, "video", 5))
    {
        if (gst_caps_features_contains(features, GST_CAPS_FEATURES_NVMM))
        {
            /* Get the source bin ghost pad */
            GstPad *bin_ghost_pad = gst_element_get_static_pad(source_bin, "src");
            if (!gst_ghost_pad_set_target(GST_GHOST_PAD(bin_ghost_pad), decoder_src_pad))
            {
                g_printerr("Failed to link decoder src pad to source bin ghost pad\n");
            }
            gst_object_unref(bin_ghost_pad);
        }
        else
        {
            g_printerr("Error: Decodebin did not pick nvidia decoder plugin.\n");
        }
    }
}
static void decodebin_child_added(GstChildProxy *child_proxy, GObject *object, gchar *name, gpointer user_data)
{
    if (g_strrstr(name, "decodebin") == name)
    {
        g_signal_connect(G_OBJECT(object), "child-added", G_CALLBACK(decodebin_child_added), user_data);
    }
    if (g_strrstr(name, "source") == name)
    {
        g_object_set(G_OBJECT(object), "drop-on-latency", TRUE, NULL);
    }
}
static GstElement *create_source_bin(guint index, gchar *uri, ReturnInfo *return_info)
{
    GstElement *bin = NULL, *uri_decode_bin = NULL;
    gchar bin_name[16] = {};
    g_snprintf(bin_name, 15, "source-bin-%02d", index);
    bin = gst_bin_new(bin_name);
    uri_decode_bin = gst_element_factory_make("nvurisrcbin", "uri-decode-bin");

    if (!bin || !uri_decode_bin)
    {
        g_log("Application-TGSD", G_LOG_LEVEL_INFO, "[ERROR] Failed to create the bin and uri_decode-bin in the created source");
        return_info->is_success = 0;
        strcpy(return_info->info, "Failed to create the bin and uri_decode-bin in the created source");
        return NULL;
    }

    g_object_set(G_OBJECT(uri_decode_bin), "uri", uri, NULL);
    g_object_set(G_OBJECT(uri_decode_bin), "rtsp-reconnect-interval", 30, NULL);

    g_signal_connect(G_OBJECT(uri_decode_bin), "pad-added", G_CALLBACK(cb_newpad), bin);
    g_signal_connect(G_OBJECT(uri_decode_bin), "child-added", G_CALLBACK(decodebin_child_added), bin);

    gst_bin_add(GST_BIN(bin), uri_decode_bin);

    if (!gst_element_add_pad(bin, gst_ghost_pad_new_no_target("src", GST_PAD_SRC)))
    {
        g_printerr("Failed to add ghost pad in source bin\n");
        return NULL;
    }

    return bin;
}

Gst_debug=3 attachments
infer.txt (131.6 KB)

  1. can the other tools like VLC/ffmpe play the h265 stream well?
  2. can the following cmd run well? does the same issue remain?
gst-launch-1.0 rtspsrc location=rtsp://"ip address"! rtph265depay ! h265parse ! queue ! nvv4l2decoder   ! fakesink

@fanzh
I’m very sorry for replying so late due to my vacation. I followed your method to execute the command, and the log is as follows
log1.txt (132.2 KB)

RTSP streams of H.264 can run normally, but H.265 cannot.It always shows’ Assuring DON field is not present ', but I haven’t found a solution online

from the log “error: Internal data stream error.”, the pipeline failed to run. could you use the following cmd to dump 30 seconds of stream data? wondering if it is related to stream.

gst-launch-1.0 rtspsrc location=rtsp://"ip address"! rtph265depay ! 'video/x-h265,stream-format=byte-stream' ! filesink location=test.h265

Sorry for the late reply, Is this still an DeepStream issue to support? Thanks! could you use the following cmd to try the software decoding? if software decoding works, that should be a hardware decoding issue.

gst-launch-1.0 rtspsrc location=rtsp://"ip address"! rtph265depay ! h265parse ! queue ! avdec_h265   ! fakesink