i modified deepstream-test1 sample code want to achieve two h264 format videos send to nvstreammux without nvstreamdemux
, because when i use nvstreamdemux i have to create 2 pipeline after nvstreammux , which is not reasonable .
can you give me some advice please? and how to distinguish videos in osd_sink_pad(nvosd).
here are original way
gst_element_link_many (source1, h264parser, decoder,NULL);
gst_element_link_many (source2, h264parser2, decoder2, NULL);
gst_element_link_many (nvstreammux, nvstreamdemux, NULL);
gst_element_link_many ( pgie, filter1, nvvidconv, filter2, nvosd, sink, NULL);
gst_element_link_many ( pgie2, filter3, nvvidconv2, filter4, nvosd2, sink2, NULL);
above is pipeline, besides i use c code based on deepstream_sample(DeepStream_Release/sources/apps/deepstream-test1) not gst-launch.
bellow is my pipeline
and if i use nvstreamdemux,as you can see, after demux i have to create 2 nvinfer , 2 nvosd…,
which is not reasonable .
so , if i don’t use nvdemux , how to accomplish my pipeline , if nvinfer element support two video streams ,and how to distinguish stream after nvstreammux.
Why we have nvstreamMux? → Support batch.
“nvinfer (detection, classification)” “nvtracker” all support batch handling.But nvosd not.
streamMux collects all channel decoded data(NV12) to its contiguous buffer and unified to be the same resolution. (These buffers are allocated in the beginning, it is reused when the pipeline is running, it is freed when the pipeline is being destroyed.) The following elements like nvinfer, nvtracker, … all get buffers from streammux as input and update metadata which is attached to the buffer.
nvosd, encoder, … do not support batch handling. So it needs streamDemux (or streamTiler) to split the different channel buffers.
So for your pipeline, you just need one nvinfer , one nvosd. One nvosd instance can handle multiple channels. And there should be have streamDemux or streamTiler before nvosd.
Hi, I need to get image buffer and inferring result from the stream with nvstreammux, how can I apply that? Adding probe in nvosd pad, and mapping from gstbuffer, mapinfo->data I get only contains 8 bytes data.
Is appsink worked? I haven’t tried that.
Thanks.
Get image buffer: Can you refer to “source/gst-plugins/gst-dsexample/gstdsexample.cpp” → “gst_dsexample_transform_ip()” → " surface = *((NvBufSurface **) in_map_info.data);"
I’ve tried that, but surface is wrong. Accessing [surface->size,width,height] causes an segmentation fault(core dumped). I print address as following:
in_map_info.data: 0x7f97ad7e5fd0
surface: 0x7a7a7a7a7a7a7a7a
surface.data: 0x7a7a7a7a7a7a7a9a
In pipeline I add video-converter before appsink for file-save using. Is it the vidconv causing this error?
In addition, the html documentation about surface has a mistake in example:
nvbuf = ((NvBufSurface)info.data)