Custom schema Json output

NVIDIA-SMI 525.105.17
Driver Version: 525.105.17
CUDA Version: 12.0
deepstream-6.2

I m trying to implement custom schema in the format which is return by generate_event_message_minimal function of event_msg_payload.cpp.

I did changes in nvmsgcov.cpp .

But i m getting output like this

{
“version” : “4.0”,
“id” : “3569”,
@timestamp” : “2023-07-09T07:32:08.330Z”,
“sensorId” : “cam0”,
“description” : “this is gate 1”,

“objects” : [
“29|897.428|225.152|1058.76|439.794|airplane_front”
]
}
only one detection information is coming

i want all the detection information in one log like this

{
“version” : “4.0”,
“id” : “3569”,
@timestamp” : “2023-07-09T07:32:08.330Z”,
“sensorId” : “cam0”,
“description” : “this is gate 1”,
“Gate_id” : “Gate_1”,
“objects” : [
“29|897.428|225.152|1058.76|439.794|airplane_front”,
“29|897.428|225.152|1058.76|439.794|car”,
“29|897.428|225.152|1058.76|439.794|person”
]
}
working with Deepstream test 5
how to get all detection of objects in custom schema using generate_event_message_minimal function?

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• 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)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

NVIDIA-SMI 525.105.17
Driver Version: 525.105.17
CUDA Version: 12.0
deepstream-6.2

±----------------------------------------------------------------------------+
| NVIDIA-SMI 525.125.06 Driver Version: 525.125.06 CUDA Version: 12.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 On | N/A |
| 0% 48C P8 35W / 370W | 3825MiB / 12288MiB | 4% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
| 1 NVIDIA GeForce … Off | 00000000:02:00.0 Off | N/A |
| 0% 46C P8 20W / 370W | 8MiB / 12288MiB | 0% Default |
| | | N/A |

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |

NVIDIA-SMI 525.105.17
Driver Version: 525.105.17
CUDA Version: 12.0
deepstream-6.2

I m trying to implement custom schema in the format which is return by generate_event_message_minimal function of event_msg_payload.cpp.

I did changes in nvmsgcov.cpp .

But i m getting output like this

{
“version” : “4.0”,
“id” : “3569”,
@timestamp” : “2023-07-09T07:32:08.330Z”,
“sensorId” : “cam0”,
“description” : “this is gate 1”,

“objects” : [
“29|897.428|225.152|1058.76|439.794|airplane_front”
]
}
only one detection information is coming

i want all the detection information in one log like this

{
“version” : “4.0”,
“id” : “3569”,
@timestamp” : “2023-07-09T07:32:08.330Z”,
“sensorId” : “cam0”,
“description” : “this is gate 1”,
“Gate_id” : “Gate_1”,
“objects” : [
“29|897.428|225.152|1058.76|439.794|airplane_front”,
“29|897.428|225.152|1058.76|439.794|car”,
“29|897.428|225.152|1058.76|439.794|person”
]
}
working with Deepstream test 5
how to get all detection of objects in custom schema using generate_event_message_minimal function?

if msg-conv-msg2p-new-api is 1, please refer to generate_dsmeta_message_minimal.

i m not using dsmeta .
msg-conv-msg2p-new-api is =0 only
i want to use already existed generate_event_message_minimal function for custom schema

i m getting output of this , but not all objects are coming in output.

nvmsgconv plugin is oepnsource, please add log in generate_event_message_minimal to debug. you can check if all object information is added to NvDsEvent.

else if (ctx->payloadType == NVDS_PAYLOAD_CUSTOM){
message = generate_event_message_minimal (ctx->privData, events, size);
cout<<“message-----”<<message;
cout<<“size----------”<<size;
cout<<“events---------”<<events;
if (message) {
len = strlen (message);
// Remove ‘\0’ character at the end of string and just copy the content.
payload->payload = g_memdup (message, len);
payload->payloadSize = len;
g_free (message);
}

else if (ctx->payloadType == NVDS_PAYLOAD_DEEPSTREAM_MINIMAL){
message = generate_event_message_minimal (ctx->privData, events, size);
cout<<“message-----”<<message;
cout<<“size----------”<<size;
cout<<“events---------”<<events;
if (message) {
len = strlen (message);
// Remove ‘\0’ character at the end of string and just copy the content.
payload->payload = g_memdup (message, len);
payload->payloadSize = len;
g_free (message);
}

for both if condition , generate_event_message_minimal (ctx->privData, events, size)
is giving different output , although same function is used .

its seems input parameter events, size are changing for both if cases .

where this events, size are assigned value in code ?
is events , size variable are hardcoded somewhere?

here is the call satck, you can add log to check.
gst_nvmsgconv_transform_ip
–nvds_msg2p_generate/nvds_msg2p_generate_multiple
----generate_event_message_minimal

i added logs and find out input paramaeter of this function generate_event_message_minimal (ctx->privData, events, size) gets change with respect to switch in values from payload custom
to PAYLOAD_DEEPSTREAM_MINIMAL.

for the case PAYLOAD_DEEPSTREAM_MINIMAL , events and size parameter are different than PAYLOAD_CUSTOM .

for PAYLOAD_CUSTOM , events contain only one object and size equals to 1 always.

please add log in gst_nvmsgconv_transform_ip to check why size is 1.

can you tell me in which file this function is there gst_nvmsgconv_transform_ip ?

There is no update from you for a period, assuming this is not an issue any more. Hence we are closing this topic. If need further support, please open a new one. Thanks.
the path is \opt\nvidia\deepstream\deepstream-6.2\sources\gst-plugins\gst-nvmsgconv\gstnvmsgconv.c

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