Modifying cb_rtspsrc_select_stream() to support mjpeg RTSP streams

Hi, this is a new topic related to this previous post:

From that previous post, I can see that the function which requires modification to support mjpeg is “cb_rtspsrc_select_stream”, from /opt/nvidia/deepstream/deepstream-6.0/sources/apps/apps-common/src/deepstream_source_bin.c.

I can see also that the offending part of the function is:

/* Add the proper depay element based on codec. */
    if (!g_strcmp0 (encoding_name, "H264")) {
      bin->depay = gst_element_factory_make ("rtph264depay", elem_name);
      g_snprintf (elem_name, sizeof (elem_name), "h264parse_elem%d", bin->bin_id);
      bin->parser = gst_element_factory_make ("h264parse", elem_name);
    } else if (!g_strcmp0 (encoding_name, "H265")) {
      bin->depay = gst_element_factory_make ("rtph265depay", elem_name);
      g_snprintf (elem_name, sizeof (elem_name), "h265parse_elem%d", bin->bin_id);
      bin->parser = gst_element_factory_make ("h265parse", elem_name);
    } else {
      NVGSTDS_WARN_MSG_V ("%s not supported", encoding_name);
      return FALSE;
    }

Could nvidia share the precise change needed to this function to support mjpeg streams alongside h264 and h265 streams ?

Hi,
This is customization and please give it a try. You can check the gstreamer pipeline is good in gst-launch-1.0 command:

$ gst-launch-1.0 rtspsrc uri=_URI_OF_RTSP_SOURCE_ ! rtpjpegdepay ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvoverlaysink 

And then apply the pipeline to deepstream-app.

Other users may have experience and can share suggestion.

1 Like

Hi,

Thanks for the suggestion, we modified the function and it worked correctly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.