Match NvDsFrameMeta with their original gstreamer Buffer

Background
I am working with Python APIs, Deepstream 6.0.1, Tesla T4, and Deepstream official develop container.

I use appsrc to feed numpy arrays to my pipeline:

img = cv2.imread("/opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_720p.jpg")
img = cv2.resize(img, (1080, 1920))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGBA)
buffer = Gst.Buffer.new_wrapped(img.tobytes())
self.source_bin_appsrc.emit("push-buffer", buffer)

The pipeline works fine, and I am able to retrieve the numpy image as well as the metadata from an object of type NvDsBatchMeta.

I am using this pipeline to create REST API that feeds numpy arrays to Deepstream.
Problem
Consider that situation where I have 2 API calls. The API call A generates a numpy_array_A and sends it to the appsrc element in the pipeline. The API call B generates a numpy_array_B and sends it to the appsrc element in the pipeline.
My pipeline process correctly the numpy arrays.
The problem is that when I retrieve the metadata, I haven’t found a way to know to which one of the two arrays (numpy_array_A or numpy_array_B) the metadata refers to.
In other works, is there a way to associated an instance of type NvDsFrameMeta to my original gstreamer buffer (created in the sample code above)? I am looking for something like an identifier that remains equal when deepstream converts the gstreamer buffer to a NvDsFrameMeta in NvDsBatchMeta. This is needed to return the correct metadata to each user of my REST API. If I had 20 concurrent calls, I need to know what metadata corresponds to every specific request.
Thank you

You can try to use the source_id para fron the NvDsFrameMeta structure.

Hi @yuweiw , thank you for your reply.
I think that source_id would allow me to identify the appsrc. However, if I have multiple frames coming through the same appsrc I don’t think I will be able to identify them, right?

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

You can consider using NvDsUserMeta to add your own tag for each gstbuffer through the probe function.

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