Strange Things Happen When Custom Metadata is Attached Before Streammux and RTSP Sources are Unstable - Potential Bug?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.4
• NVIDIA GPU Driver Version (valid for GPU only) 535
• Issue Type( questions, new requirements, bugs) Bug?
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

I need to attach custom metadata before streammux element. I attach both on raw GST Buffer with gst_buffer_add_custom_meta and on NvDs metadata with gst_buffer_add_nvds_meta, very similar to the “deepstream-gst-metadata-test” example. The reason I also need the former is I also want to achieve the same metadata on another branch in the pipeline in parallel, irrelevant to the deepstream and its relevant elements in the pipeline.

This normally works alright in normal circumstances. However, when RTSP sources are not stable, due to issues like network jitters, things get quite weird. In this unstable streams, when we frequently get “Discontinued GST Buffers”:

  • When I have the raw GST metadata attached, when this metadata is tried to be copied in streammux (closed source deepstream code) it tries to allocate tons of gigabytes of memory occasionally, and it just segfaults. The way I had to handle this is, I deep copied the GST buffer just before streammux and remove the attached custom metadata, and the problem was “resolved”.
  • Also, when I have the normal NvDs metadata attached in the formal way it’s explained in the docs and examples, occasionally again, the content of the metadata is corrupted. I know that the source of the data is fine, because I checked the value and integrity of the data in both the relevant variable in the program, and the raw metadata attached to the GST buffer directly, and it looks fine. It’s only corrupted in NvDs structure, when I try to access it from nvds user meta. It’s also corrupted when my callback for copy function is called, set in gst_buffer_add_nvds_meta

I don’t know what is wrong, and since that piece is not open source, I also have no visibility into what’s actually going on.

I have a super simple script that breaks a normal rtsp stream to trigger such discontinued buffers to reproduce this behaviour. It just enables and disables firewall frequently to create discontinuity in the stream, and I can share it if you want.

Have you tried deepstream-gst-metadata-test sample? Is there any problem you met with the original deepstream-gst-metadata-test?

I’ve tried with the modified sample, it can work with rtsp input. Nothing wrong met after 1 hour.

deepstream_gst_metadata.c (22.3 KB)

The command is

./deepstream-gst-metadata-app rtsp://xxxx/xxxx

If the RTSP source is stable, it works fine. You need to get many discontinued buffers, with GST_BUFFER_FLAG_DISCONT is set. One super simple way to trigger that is with the attached script: (couldn’t upload sh directly, don’t forget to convert)
discont_buffers_sim_shared.txt (1.1 KB)

Can you also try testing it with this script running in the background?

No. I met nothing wrong with the attached script and the modified deepstream-gst-metadata-test above after running a hour.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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