Is it possible to send stream to a sink only when an object has been detected by the inference plugin?

Wondering if its possible to dynamically send to a sink only when an object has been detected by the inference plugin?
While objects are detected I would like to use the kvssink plugin which sends the stream to AWS Kinesis.

Hi,
You may try the suggestion.

Ok thanks for the reply. The post you mentioned just says that it can’t be done via config however can be coded using a probe to read the metadata. But what then. How do you tell gstreamer to carry on and send the data to the sink based on an object detection in the metadata.
Maybe it’s not possible and I just have to effectively write my own sink code inside the probe??

Hi,
On DS4.0.1, there is no existing sample and you may need to do the implementation.

Would it be best to implement as a probe or a completely separate gstreamer plugin ?

I’d write a probe that drops the buffer, if it doesn’t find an object in the frame’s meta. The GstPadProbeCallback returns an enum of type GstPadProbeReturn, which can be:

GST_PAD_PROBE_DROP (0) – drop data in data probes. For push mode this means that the data item is not sent downstream.

Certainly, you could write a custom element that does this, but if it’s not a big deal for you to add this probe function in your app, then that’s the easiest way to go.

Either way, if you’re using the deepstream-app, make sure it’s downstream of their probe that syncs on the SGIEs’ completion.

See:

Thanks @Matt-G, I will give this a try… ;-)
My main aim here is to send “events” where people are detected to cloud storage using amazon kinesis. Kinesis provide a gstreamer plugin call kvssink and the source is provided. So another option may be to edit the source to read the upstream inference metadata and decide whether to push the frames to the cloud or not.
I’ll think I’ll start with you probe option first though… thx.

Hi,
For ending metadata, you may refer to deepstream-test4 and deepstream-test5 samples. Not sure but it can be possible to integrate the samples with kvssink.