Gstreamer Pipeline issue : PosixMemMap:84 mmap failed

• Hardware Platform (Jetson / GPU) : Jetson Orin Nano
• DeepStream Version : 6.3
• JetPack Version (valid for Jetson only) 5.1.2

Context : I have an application which is using a gstreamer pipeline in order to get videos from cameras and to send it through UDP. I apply face and person detection on those videos. The new video created thanks to the pipeline allow me to display it on a browser. I have usually 4 cameras and i show the video of one of them depending on the situation. I have the 4 videos that are used but only one is displayed. I’m using Python librairy in order to use gstreamer.

Pipeline : gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544! nvinfer config-file-path=path ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=50 ! udpsink host=host port=port

Problem : I get, after some minutes/hours of running, a crash of my application. Watching the error messages, i have an impression that it comes from one of the element of the pipeline.

If you need more informations about my problem don’t hesitate to ask ! I thank you all for helping me.

Hi,
Looks like you have only single source. In this setup, please set batch-size=1 to nvstreammux. And please remove nvvidconv. In DeepStream SDK, please use only nvvideoconvert

There are gst-launch-1.0 commands for your reference:
Adding a ghost pad after splitting a pipeline using Tee? - #11 by DaneLLL
Could not link nvarguscamerasrc0 to nvstreammux0 - #10 by DaneLLL
Writing a custom Gstreamer plugin - #3 by DaneLLL
Nvmultistreamtiler/nvstreamdemux with omxh264enc won't work - #5 by DaneLLL

Hello, thanks for your answer.
But in my python code it is quite different. I have multiple camera for the nvstreammux.

Those cameras have those characteristics

I have also adjusted some properties for nvstreammux

I’m sorry for the quality of the screenshot but i could not provide more than one picture.

The pipeline that i have given in the first message it is an big idea of my pipeline. Sorry for the mistakes that i have provided last week.

Hi,
We would suggest launch the use-case in gst-launch-1.0 command. Once you have a working gst-launch-1.0 command, you can refer to it to debug the python code.

Hello !
I’m using cameras from Econ.
From the pipeline that i have sent to you, I have changed it a little but by taking out the nvdsosd element from the pipeline. I didn’t see the problem appearing again. I think the errors came from this element. The problem is that I don’t have any bounding box on my video anymore.

Hi,
Do you have nvmultistreamtiler plugin in the pipeline? Since you have multiple sources, you would need the plugin to composite the sources to single video plane.

Hello,
I’m using nvstreammux and nvstreamdemux for managing the different sources.
Thanks for you help, sorry that i don’t manage to really explain well
Here is the picture showing the different elements :

Hi,
We would like to reproduce the issue with v4l2src. The command looks wrong:

Pipeline : gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! m.sink_0 nvstreammux name=m batch-size=2 width=960 height=544! nvinfer config-file-path=path ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=50 ! udpsink host=host port=port

The batch-size is set to 2 in nvstreammux but there is only one v4l2src. Please check this and help try on Orin Nano developer kit. And share us the correct gst-launch-1.0 command. We can set up two v4l2src by using USB cameras.

Hi,
Here is the pipeline that I use. Thanks again for your help.

gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 v4l2src device=/dev/video1 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_1 v4l2src device=/dev/video2 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_2 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1536, framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=(string)I420, width=(int)960,height=(int)544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA”! m.sink_3 nvstreammux name=m batch-size=2 width=960 height=544 batched-push-timeout=40000 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/path/to/file ! nvmultistreamtiler width=1920 height=1080 ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=50 ! udpsink host=20.21.4.2 port=5005

Hi,
We run the command on Orin Nano developer kit + 4 USB cameras with 5.1.3 + DS SDK 6.3:

gst-launch-1.0 -e nvstreammux name=m batch-size=4 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! \
nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary_b4.txt ! nvmultistreamtiler width=1920 height=1080 rows=2 columns=2 ! \
nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=50 ! rtpjpegpay ! udpsink host=10.19.106.10 port=5005 sync=0 \
v4l2src device=/dev/video1 ! "video/x-raw,format=YUY2,width=640,height=480,framerate=30/1" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=I420, width=960,height=544" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! m.sink_0 \
v4l2src device=/dev/video3 ! "video/x-raw,format=UYVY,width=1280,height=720,framerate=30/1" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=I420, width=960,height=544" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! m.sink_1 \
v4l2src device=/dev/video5 ! "video/x-raw,format=UYVY,width=640,height=480,framerate=30/1" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=I420, width=960,height=544" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! m.sink_2 \
v4l2src device=/dev/video7 ! "video/x-raw,format=YUY2,width=640,height=480,framerate=30/1" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=I420, width=960,height=544" ! nvvideoconvert ! "video/x-raw(memory:NVMM), format=RGBA" ! m.sink_3

[config_infer_primary_b4.txt]

################################################################################
# Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
################################################################################

# Following properties are mandatory when engine files are not specified:
#   int8-calib-file(Only in INT8)
#   Caffemodel mandatory properties: model-file, proto-file, output-blob-names
#   UFF: uff-file, input-dims, uff-input-blob-name, output-blob-names
#   ONNX: onnx-file
#
# Mandatory properties for detectors:
#   num-detected-classes
#
# Optional properties for detectors:
#   cluster-mode(Default=Group Rectangles), interval(Primary mode only, Default=0)
#   custom-lib-path,
#   parse-bbox-func-name
#
# Mandatory properties for classifiers:
#   classifier-threshold, is-classifier
#
# Optional properties for classifiers:
#   classifier-async-mode(Secondary mode only, Default=false)
#
# Optional properties in secondary mode:
#   operate-on-gie-id(Default=0), operate-on-class-ids(Defaults to all classes),
#   input-object-min-width, input-object-min-height, input-object-max-width,
#   input-object-max-height
#
# Following properties are always recommended:
#   batch-size(Default=1)
#
# Other optional properties:
#   net-scale-factor(Default=1), network-mode(Default=0 i.e FP32),
#   model-color-format(Default=0 i.e. RGB) model-engine-file, labelfile-path,
#   mean-file, gie-unique-id(Default=0), offsets, process-mode (Default=1 i.e. primary),
#   custom-lib-path, network-mode(Default=0 i.e FP32)
#
# The values in the config file are overridden by values set through GObject
# properties.

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-file=../../models/Primary_Detector/resnet10.caffemodel
proto-file=../../models/Primary_Detector/resnet10.prototxt
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b4_gpu0_int8.engine
labelfile-path=../../models/Primary_Detector/labels.txt
int8-calib-file=../../models/Primary_Detector/cal_trt.bin
batch-size=4
process-mode=1
model-color-format=0
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=1
num-detected-classes=4
interval=0
gie-unique-id=1
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid
force-implicit-batch-dim=1
#parse-bbox-func-name=NvDsInferParseCustomResnet
#custom-lib-path=/path/to/this/directory/libnvds_infercustomparser.so
## 1=DBSCAN, 2=NMS, 3= DBSCAN+NMS Hybrid, 4 = None(No clustering)
cluster-mode=2
#scaling-filter=0
#scaling-compute-hw=0

#Use the config params below for dbscan clustering mode
#[class-attrs-all]
#detected-min-w=4
#detected-min-h=4
#minBoxes=3

#Use the config params below for NMS clustering mode
[class-attrs-all]
topk=20
nms-iou-threshold=0.5
pre-cluster-threshold=0.2

## Per class configurations
[class-attrs-0]
topk=20
nms-iou-threshold=0.5
pre-cluster-threshold=0.4

#[class-attrs-1]
#pre-cluster-threshold=0.05
#eps=0.7
#dbscan-min-score=0.5

#[class-attrs-2]
#pre-cluster-threshold=0.1
#eps=0.6
#dbscan-min-score=0.95

#[class-attrs-3]
#pre-cluster-threshold=0.05
#eps=0.7
#dbscan-min-score=0.5

It passed overnight and is still running.
(Our 4 USB cameras are different so caps are set differently)

For information, how long does it take to hit the issue in your setup?

Thanks for sharing your command, i don’t have my setup right now, I will try next week.
The issue appeared after more or less 1h30min.

Hi
We have run the test for 3+ days and it is still on-going. Please give it a try and see if you can run the gst-launch-1.0 command without issue in your setup.

Hello,
I have tried your proposition (by changing a little the pipeline to meet my elements) :

gst-launch-1.0 -e nvstreammux name=m batch-size=4 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/path ! nvmultistreamtiler width=1920 height=1080 rows=2 columns=2 ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=30 ! udpsink host=20.21.4.2 port=5005 sync=0 v4l2src device=/dev/video0 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 v4l2src device=/dev/video1 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_1 v4l2src device=/dev/video2 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_2 v4l2src device=/dev/video3 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_3

And after 1h30 minutes i got this little error message :

Hi,
The issue may be from the camera sources. Probably it is not stable in long run. Please replace v4l2src with videotestsrc is-live=1 and try. To check if the issue is specific to using the cameras.

Hello,
I have tried as you say the new pipeline :
gst-launch-1.0 -e nvstreammux name=m batch-size=4 width=960 height=544 batched-push-timeout=33333 sync_inputs=1 live-source=1 ! nvinfer config-file-path=/path ! nvmultistreamtiler width=1920 height=1080 rows=2 columns=2 ! nvvideoconvert ! nvdsosd ! nvvideoconvert ! nvjpegenc quality=30 ! udpsink host=20.21.4.2 port=5005 sync=0 videotestsrc is-live=1 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_0 videotestsrc is-live=1 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_1 videotestsrc is-live=1 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_2 videotestsrc is-live=1 ! “video/x-raw,format=UYVY,width=1920,height=1536,framerate=30/1” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420, width=960,height=544” ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=RGBA” ! m.sink_3

It has been running for 2hours now and the problem is not appearing. I will let it run a little longer.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.