But I don’t know the last streammux when batched the buffers, initialize the metadata by default or can pass the all of buffers and metadata upstream toward downstream?
Write an custom gstreamer plugin like nvstreammux:
Suppose we linked two buffer into custom plugin.
one buffer has 2 streams and its metadata and other has 2 streams and its metata that generated by upstream nvinfer.
My goal is that in this custom plugin, i batched these two buffer into one batched buffer and passed into next nvinfer.
Because the functionality of this custom plugin is sequential, that means in the timestamp 1 the buffer 1 goes into plugin and and in the timestamp 2 the buffer 2 goes into plugin.
In this plugin I want to keep the frame_mata of buffer 1 into list and when the buffer 2 goes into plugin and then append the list of frame_meta of buffer 1 into buffer 2 and then send push buffer.
self, pad: Gst.Pad, parent, buffer: Gst.Buffer
) -> Gst.FlowReturn:
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(buffer))
l_frame = batch_meta.frame_meta_list
while l_frame is not None:
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
l_frame = l_frame.next
if len(self.frames_meta) == 4 :
for frameMeta in self.frames_meta[:2]:
self.frames_meta = 
In general, I have 4 streams , two streams(index=0,1) are for buffer 1 and two streams(index=2,3) are for buffer 2.
In above code I only two previous frame metadata (first two frames meta) append into new batch, I got this error:
Segmentation fault (core dumped)
When I only append last frame meta into batch meta, it’s works correctly, and I get batch_size = 3 (three frame meta)in the next element.
In my opinion, the frame meta is pointer in the c++, and the all of frame meta pointed into same address of memory, and when I want to append the previous frame meta into currect batch meta, I got Segmentation fault (core dumped). right? How I can handle this problem?