Generating Custom Messages Using Message Converter

Hi!

I was trying to customize the message format that DeepStream produces when sinking messages to a message queue. Docs refers the subject briefly, but it was not enough for me to configure DeepStream as it generates messages in a custom format.

Here is my default sink configuration:

[sink1]
enable=1
type=6
msg-conv-config=dstest5_msgconv_sample_config.txt
msg-conv-payload-type=0
msg-conv-msg2p-new-api=0
msg-conv-frame-interval=30
msg-broker-proto-lib=/opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so
msg-broker-conn-str=172.16.44.101;32438;my-topic
topic=my-topic

and here’s the sample output of the Kafka consumer, which is in default DeepStream message format:

{
  "messageid" : "bc836b1e-474c-44b9-bfe2-32e554f7b45e",
  "mdsversion" : "1.0",
  "@timestamp" : "2024-05-09T13:43:28.345Z",
  "place" : {
    "id" : "0",
    "name" : "HWY_20_AND_LOCUST__EBA",
    "type" : "intersection/road",
    "location" : {
      "lat" : 30.32,
      "lon" : -40.549999999999997,
      "alt" : 100.0
    },
    "entrance" : {
      "name" : "C_127_158",
      "lane" : "Lane 1",
      "level" : "P1",
      "coordinate" : {
        "x" : 1.0,
        "y" : 2.0,
        "z" : 3.0
      }
    }
  },
  "sensor" : {
    "id" : "HWY_20_AND_LOCUST__EBA__4_11_2018_4_59_59_508_AM_UTC-07_00",
    "type" : "Camera",
    "description" : "Aisle Camera",
    "location" : {
      "lat" : 45.293701446999997,
      "lon" : -75.830391449900006,
      "alt" : 48.155747933800001
    },
    "coordinate" : {
      "x" : 5.2000000000000002,
      "y" : 10.1,
      "z" : 11.199999999999999
    }
  },
  "analyticsModule" : {
    "id" : "XYZ_1",
    "description" : "Vehicle Detection and License Plate Recognition",
    "source" : "OpenALR",
    "version" : "1.0"
  },
  "object" : {
    "id" : "5",
    "speed" : 0.0,
    "direction" : 0.0,
    "orientation" : 0.0,
    "person" : {    },
    "bbox" : {
      "topleftx" : 739,
      "toplefty" : 312,
      "bottomrightx" : 1030,
      "bottomrighty" : 513
    },
    "location" : {
      "lat" : 0.0,
      "lon" : 0.0,
      "alt" : 0.0
    },
    "coordinate" : {
      "x" : 0.0,
      "y" : 0.0,
      "z" : 0.0
    },
    "pose" : {    }
  },
  "event" : {
    "id" : "23eab5d7-8c54-47e4-afb6-0e6560aad7ee",
    "type" : "entry"
  },
  "videoPath" : ""
}

Now, say that I want to add just one field named customField in type string to this format, to the same level with messageId field. What would be the steps that I need to go through? I’d be appreciated if someone can help me on this.

Thanks in advance!

ps. Documentation also says that we can edit sources/libs/nvmsgconv/deepstream_schema/eventmsg_payload.cpp and sources/libs/nvmsgconv/deepstream_schema/dsmeta_payload.cpp for schema customization. How can I find & investigate those C++ codes online?

•DeepStream Version: 6.4
•Issue Type: Question

if you need to add new message, please refer to the doc. please refer to this topic. the code path is /opt/nvidia/deepstream/deepstream/sources/libs/nvmsgconv/.

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.