How to extract the JSON payload metadata after nvmsconv in deepstream-test4

Continuing the discussion from Question about MsgConv plugin:

• Hardware Platform : dGPU
• DeepStream Version : 5.1
• TensorRT Version: 7.2.2-1+cuda11.1
• Issue Type: Question

NvMsgConv plugin(low level api) is responsible to generate JSON payload schema after parsing NvDsEventMsgMeta.

  • I wanted to access/print the messages(i.e. JSON messages) for each frames.
  • After nvmsgconv and before sending it to next plugin i.e. nvmsgbroker, how can I get that JSON payload schema or at which location this JSON payload schema can be accessed??

like below :
Frame Number = 0 Vehicle Count = 4 Person Count = 2
{
“version” : “4.0”,
“id” : 0,
@timestamp” : “2021-05-12T09:13:14.646Z”,
“sensorId” : “sensor-0”,
“objects” : [
“-1|510|457.826|549|487.174|Vehicle|#|sedan|Bugatti|M|blue|XX1234|CA|-0.1”
]
}
Frame Number = 1 Vehicle Count = 4 Person Count = 2
{
{[…]
}
}
Frame Number = 2 Vehicle Count = 4 Person Count = 2

1. And there is no documentation for the functions of gst-nvmsgconv.(/opt/nvidia/deepstream/deepstream-5.1/sources/gst-plugins/gst-nvmsgconv)

2. Is there any modification required in gst-nvmsgconv to achieve above?
3. In sources/gst-plugins/gst-nvmsgconv/gstnvmsgconv.c what is gst_nvmsgconv_transform_ip() ??

Thanks in advance!!

The schema message is in the usermeta of the frame. The meta_type is NVDS_PAYLOAD_META

The gst-nvmsgconv is designed to generate schema message for nvmsgbroker. It is not recommended to access schema message in application.

No

Do you know about gstreamer https://gstreamer.freedesktop.org/? Please make sure you know the basic knowledge and coding skills for gstreamer before you start with deepstream.
It is gstreamer plugin callback function. GstBaseTransform (gstreamer.freedesktop.org)

I want to add a probe to extract JSON payload between nvmsgconv and nvmsgbroker.

The schema message is in the usermeta of the frame. The meta_type is NVDS_PAYLOAD_META.
You can get such user meta and then you can get the Jason message.

@Fiona.Chen
for the JSON how can we call NvDsPayload *payload in the probe?

def msgconv_sink_pad_buffer_probe(?,?):

and

msgconvsinkpad.add_probe(Gst.PadProbeType.BUFFER, msgconv_sink_pad_buffer_probe, 0)

Thanks for the help!!

Do you mean “python”? There is sample in deepstream-ssd-parser of how to get user meta from frame meta, you can refer to it and write your own code to get user meta from object meta.

And there is also lots of samples of how to add pad probe function already.