I am writing a plugin that follows immediately after the source.
I want to send NvDsFrameMeta/NvDsObjectMeta downstream.
The examples use NvDsBatchMeta retrieved from the input GstBuffer
either using
gst_buffer_get_nvds_batch_meta
or
gst_buffer_iterate_meta
to get NvDsFrameMeta objects from a pool.
But since this is the first non-source plugin in the pipeline,
the input GstBuffer does not have NvDsBatchMeta, so gst_buffer_get_nvds_batch_meta
and gst_buffer_get_nvds_batch_meta does not give me any NvDsBatchMeta
How do I inject NvDsBatchMeta/NvDsFrameMeta/NvDsObjectMeta into
the pipeline that is compatible with plugins like nvdsosd.
We need to know the exact pipeline that you’re trying.
It seems that you have frame/obj level info generated before nvstreammux. However, batch meta is formed inside nvstreammux as batch creation takes place inside this component.
So, you can use dsexample tailored for it’s use case after nvstreammux and can acquire batch meta and fill in and attach frame or object meta.
Deepstream-4.0 has new metadata design. This simplifies the overall metadata access compared to earlier Deepstream versions.
It has hierarchical structure where batch meta consists of framemeta, framemeta consists of object meta.
In Deepstream-4.0, nvstreammux is always required as it is going to create the batchmeta. Once this meta is created the remaining plugins will acquire framemeta, object meta from the respective metadata pool.
So, yes, user need to create following pipeline.
uridecodebin ! nvstreammux ! plugin1 | nvtracker | plugin2 | nvosd | …
In this pipeline plugin1 will acquire framemeta from batchmeta (provided API nvds_acquire_frame_meta_from_pool).
Then user can fill in the frame metadata and add it back to batchmeta.