How to append DeepStream Metadata in Python without using Streammux / nvinfer for parallel branch?

What I mean by that, is that some branches don’t use deepstream plugins, but just gstreamer.

The (simplified) pipeline looks like this:

src1 ---- T --- Queue1 ----- nvinfer ---- ... --- sink [ AI branch ]
              - Queue2 ----- nvconv -- nvdsosd  --- sink [ replication branch ]
              - Queue3 ----- ... --- udpsink [ restream branch ]

This is a very high-level overview of the pipeline.

The AI branch, takes the input stream and processes it using a custom model. using output-tensor-meta = 1 as to extract the output tensor.

The replication branch aims to replicate the nvinfer preprocessing steps happening inside the nvinfer module, so that we can probe them and compare them to the ouput from AI branch.

The restream branch, restreams the input.

I need to figure out how to best compare each input to output from the model for each unique frame.
Thus I need

  1. keep track of exact frame numbers (here comes DeepStream metadata?)
  2. extract exact input to the model (here comes replication branch)
  3. Do something when input/output accomplish some condition.

The full pipeline is comprised of more branches but they don’t interact with these 3, and is also comprised of multiple sources which all do the same.