Nvmsgconv

I’m trying to understand the nvmsgconv and nvmsgbroker.
I have an application in Qt + QML and I need to start the gstreamer pipe as started using gst-launch. Now my pipeline looks like this:

gst-launch-1.0 \
    nvarguscamerasrc sensor-id=0 ! \
    nvmux.sink_0 nvstreammux name=nvmux ... ! \
    nvinfer config-file-path=nvinfer-config1.txt ! \
    nvtracker ... \
    nvinfer config-file-path=nvinfer-config2.txt ! \
    tee name=t ! \
        queue ! \
            nvmsgconv \
                msg2p-lib=lib/libnvdsmsgconv.so \
                config=msgconv-config.txt \
                payload-type=0 ! \
            nvmsgbroker \
                proto-lib=lib/libmqtt_client.so \
                topic='abcd' \
                config=msgbroker-config.txt \
        t. ! queue ! \
            nvvideoconvert ! \
            nvdsosd ... \
            qtvideosink

QML requests the gstreamer pipeline written in the same way as it was written on command line.
I cannot create the pipeline in C or Python so I’m not able to attach a probe function to pad of any element.
I have my custom library for nvmsgconv but the nvds_msg2p_generate() was never called. I think that there
are no events or event metada in the stream.

If I write a probe in Python and attach it to nvdsosd, it worked properly.

I do not understand:

  • Where are the events (NvDsEvent} created?
  • Can I write a C library to add the NvDsEventMsgMeta to the stream not attached to gstreamer pad?

I can send the messages to mqtt directly from nvdsinfer parse-bbox-func-name function but I think it would be better to use the standard nvinfer ! nvtracker ! nvinfer ! nvmsgconv ! nvmsgbroker pipeline.

• Hardware Platform (Jetson / GPU)
Jetson Nano

• DeepStream Version
5.1

i do not think you can add the NvDsEventMsgMeta to nvdsinfer parse-bbox-func-name function, but you can put it in sources/gst-plugins/gst-nvinfer/gstnvinfer_meta_utils.cpp based on the model type, choose which function you should use.

Thank you.

I’v copied the whole directory to my own project and compiled the libnvdsgst_infer.so plugin. Then I started the gstreamer with --gst-plugin-load option:

gst-launch-1.0 --gst-plugin-load=/path-to/gst-nvinfer/libnvdsgst_infer.so \
    nvarguscamerasrc sensor-id=0 ! \
    nvmux.sink_0 nvstreammux name=nvmux ... ! \
    nvinfer config-file-path=nvinfer-config1.txt ! \
    nvtracker ... 

Then my own version of libnvdsgst_infer were called instead of system’s one.
I believe that I could be able modify the metadata now.

It’s working!
Now I have an answer to the first question, too.
The event is created by adding NvDsEventMeta to the stream in a custom function.

Great!!!