Hi Kayccc,
I’ve tested the provided libraries on the latest Tegra and DGPU platforms.
Both, the DeepStream 5.0.1_1 version as well as the new libraries act in the same way.
They don’t crash anymore, BUT the video buffers don’t go through if the demuxer is directly combined with a muxer.
Putting a composer behind the demuxer (via nvvideoconvert to handle NVMM) shows an interesting GST_DEBUG Error message telling us that the demuxer does not provide the correct buffer size, which could be another indicator for an issue in the demuxer library:
0:00:04.421583027 12283 0x56532d263a30 ERROR default video-frame.c:175:gst_video_frame_map_id: invalid buffer size 64 < 4884480
0:00:04.421594047 12283 0x56532d263a30 WARN compositor compositor.c:546:gst_compositor_pad_prepare_frame:<compositor> Could not map input buffer
I’ve just modified the deepstream-test3-app.c by inserting a demuxer/muxer combination into the pipeline for the case of two input sources.
Please find the diff file below:
diff deepstream_test3_app.c deepstream_test3_app.c_original
434,462d433
<
< // ==================================================================================================
< // ===================== Insert Demuxer/Muxer Combination in between PGIE and Tiler =================
< // ==================================================================================================
< GstElement *streamdemux = gst_element_factory_make("nvstreamdemux", "stream-demuxer");
< GstElement *streammux_2 = gst_element_factory_make ("nvstreammux", "stream-muxer_2");
< if (!streamdemux || !streammux_2) {
< g_printerr("streamdemux or streammux_2 could not be created!\n");
< exit(-1);
< }
< g_object_set (G_OBJECT (streammux_2), "batch-size", num_sources, NULL);
< g_object_set (G_OBJECT (streammux_2), "width", MUXER_OUTPUT_WIDTH, "height", MUXER_OUTPUT_HEIGHT,"batched-push-timeout", MUXER_BATCH_TIMEOUT_USEC, NULL);
<
< // First connect the demuxer with the muxer to handle 2 sources
< GstPad *srcpad_0 = gst_element_get_request_pad (streamdemux, "src_0");
< GstPad *srcpad_1 = gst_element_get_request_pad (streamdemux, "src_1");
< GstPad *sinkpad_0 = gst_element_get_request_pad (streammux_2, "sink_0");
< GstPad *sinkpad_1 = gst_element_get_request_pad (streammux_2, "sink_1");
<
< // We only link for 2 sources!
< if (gst_pad_link (srcpad_0, sinkpad_0) != GST_PAD_LINK_OK) {
< g_printerr ("Failed to link srcpad_0 to sinkpad_0!\n");
< exit(-1);
< }
<
< if (gst_pad_link (srcpad_1, sinkpad_1) != GST_PAD_LINK_OK) {
< g_printerr ("Failed to link srcpad_1 to sinkpad_1!\n");
< exit(-1);
< }
466d436
< // Additionall we are inserting the demuxer - muxer combination right in front of the tiler!
468c438,439
< gst_bin_add_many (GST_BIN (pipeline), pgie, streamdemux, streammux_2, tiler, nvvidconv, nvosd, transform, sink, NULL);
---
> gst_bin_add_many (GST_BIN (pipeline), queue1, pgie, queue2, tiler, queue3,
> nvvidconv, queue4, nvosd, queue5, transform, sink, NULL);
471,475c442,443
< if (!gst_element_link_many (streammux, pgie, streamdemux, NULL)) {
< g_printerr ("Elements could not be linked. Exiting.\n");
< return -1;
< }
< if (!gst_element_link_many (streammux_2, tiler, nvvidconv, nvosd, transform, sink, NULL)) {
---
> if (!gst_element_link_many (streammux, queue1, pgie, queue2, tiler, queue3,
> nvvidconv, queue4, nvosd, queue5, transform, sink, NULL)) {
480c448,449
< gst_bin_add_many (GST_BIN (pipeline), pgie, streamdemux, streammux_2, tiler, nvvidconv, nvosd, sink, NULL);
---
> gst_bin_add_many (GST_BIN (pipeline), queue1, pgie, queue2, tiler, queue3,
> nvvidconv, queue4, nvosd, queue5, sink, NULL);
483,494c452,453
<
< if (!gst_element_link_many (streammux, pgie, streamdemux, NULL)) {
< g_printerr ("Elements could not be linked. Exiting.\n");
< return -1;
< }
< if (!gst_element_link_many (streammux_2, tiler, nvvidconv, nvosd, sink, NULL)) {
< g_printerr ("Elements could not be linked. Exiting.\n");
< return -1;
< }
< /*
< // Working Pipeline
< if (!gst_element_link_many (streammux, queue1, pgie, queue2, tiler, queue3, nvvidconv, queue4, nvosd, queue5, sink, NULL)) {
---
> if (!gst_element_link_many (streammux, queue1, pgie, queue2, tiler, queue3,
> nvvidconv, queue4, nvosd, queue5, sink, NULL)) {
498d456
< */