Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.3
• TensorRT Version 8.5.3-1+cuda11.8
• NVIDIA GPU Driver Version (valid for GPU only) 550.142
• Issue Type( questions, new requirements, bugs) questions
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
Python 3.8.10
I tried using the Python version of Deepstream to add custom SEI information to H264 encoding, but I was unable to succeed.
I used the following code, but couldn’t find any information in SEI.
This code from deepstream_python_apps/apps/deepstream-imagedata-multistream-redaction/deepstream_imagedata-multistream_redaction.py at master · NVIDIA-AI-IOT/deepstream_python_apps
def add_custom_metadata(pad, info):
gst_buffer = info.get_buffer()
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
pyds.nvds_acquire_meta_lock(batch_meta)
l_frame = batch_meta.frame_meta_list
while l_frame is not None:
try:
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
frame_number = frame_meta.frame_num
except StopIteration:
break
user_meta = pyds.nvds_acquire_user_meta_from_pool(batch_meta)
if user_meta:
test_string = 'test message ' + str(frame_number)
print('adding user meta', test_string)
data = pyds.alloc_custom_struct(user_meta)
data.message = test_string
data.message = pyds.get_string(data.message)
data.structId = frame_number
data.sampleInt = frame_number + 1
user_meta.user_meta_data = data
user_meta.base_meta.meta_type = pyds.NvDsMetaType.NVDS_USER_META
pyds.nvds_add_user_meta_to_frame(frame_meta, user_meta)
else:
print('failed to acquire user meta')
try:
l_frame = l_frame.next
except StopIteration:
break
pyds.nvds_release_meta_lock(batch_meta)
return Gst.PadProbeReturn.OK
...
streammux_src_pad = streammux.get_static_pad("src")
streammux_src_pad.add_probe(Gst.PadProbeType.BUFFER, add_custom_metadata)
...
nvdsmetainsert = Gst.ElementFactory.make("nvdsmetainsert", "meta-insert")
nvdsmetainsert.set_property("serialize-lib", "libnvds_sei_serialization.so")
pipeline.add(nvdsmetainsert)
...
caps.link(nvdsmetainsert)
nvdsmetainsert.link(encoder)
...
I have tried inserting metadata in different locations, but it seems to have had no effect
** Reference **
Gst-nvdsmetautils — DeepStream documentation