Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
GPU
• DeepStream Version
6.1
• NVIDIA GPU Driver Version (valid for GPU only)
510.47.03
• Issue Type( questions, new requirements, bugs)
bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
I ran deepstream-app in nvcr.io/nvidia/deepstream:6.1-devel container with some code changed.
./deepstream-app -c /opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app/source2_1080p_dec_infer-resnet_demux_int8.txt
Here’s some code I added to encode image data.
static GstPadProbeReturn
gie_primary_processing_done_buf_prob (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{
GstBuffer *buf = (GstBuffer *) info->data;
GstMapInfo inmap = GST_MAP_INFO_INIT;
if (!gst_buffer_map (buf, &inmap, GST_MAP_READ)) {
return GST_PAD_PROBE_OK;
}
NvBufSurface *ip_surf = (NvBufSurface *) inmap.data;
gst_buffer_unmap (buf, &inmap);
AppCtx *appCtx = (AppCtx *) u_data;
NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta (buf);
if (!batch_meta) {
NVGSTDS_WARN_MSG_V ("Batch meta not found for buffer %p", buf);
return GST_PAD_PROBE_OK;
}
//write_kitti_output (appCtx, batch_meta);
//encode jpg here
int imageCount = 0;
for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = l_frame->data;
for (NvDsMetaList * l_obj = frame_meta->obj_meta_list; l_obj != NULL;
l_obj = l_obj->next) {
NvDsObjectMeta *obj = (NvDsObjectMeta *) l_obj->data;
float left = obj->rect_params.left;
float top = obj->rect_params.top;
float right = left + obj->rect_params.width;
float bottom = top + obj->rect_params.height;
// Here confidence stores detection confidence, since dump gie output
// is before tracker plugin
float confidence = obj->confidence;
// fprintf (bbox_params_dump_file,
// "%s 0.0 0 0.0 %f %f %f %f 0.0 0.0 0.0 0.0 0.0 0.0 0.0 %f\n",
// obj->obj_label, left, top, right, bottom, confidence);
NvDsObjEncUsrArgs userData = { 0 };
/* To be set by user */
userData.saveImg = false;
userData.attachUsrMeta = true;
/* Set if Image scaling Required */
userData.scaleImg = FALSE;
userData.scaledWidth = 0;
userData.scaledHeight = 0;
/* Preset */
userData.objNum = imageCount++;
/* Quality */
userData.quality = 30;
/*Main Function Call */
if(!nvds_obj_enc_process (appCtx->jpg_handle, &userData, ip_surf, obj, frame_meta)) {
g_print("jpg encode failed!\n");
}
}
}
nvds_obj_enc_finish (appCtx->jpg_handle);
return GST_PAD_PROBE_OK;
}
And here’s part of my config file:
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=4
#uri=file://../../streams/sample_1080p_h264.mp4
uri=rtsp://
num-sources=1
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device - Memory type Device
# (1): memtype_pinned - Memory type Host Pinned
# (2): memtype_unified - Memory type Unified
cudadec-memtype=0
[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=4
#uri=file://../../streams/sample_1080p_h264.mp4
uri=rtsp://
num-sources=1
gpu-id=0
# (0): memtype_device - Memory type Device
# (1): memtype_pinned - Memory type Host Pinned
# (2): memtype_unified - Memory type Unified
cudadec-memtype=0
[source2]
enable=2
type=4
uri=rtsp://
num-sources=1
gpu-id=0
cudadec-memtype=0
[sink0]
#source0 output as filesink
enable=0
...
[sink1]
#source1 output as filesink
enable=0
...
[osd]
enable=0
...
[streammux]
#gpu-id=0
##Boolean property to inform muxer that sources are live
#live-source=0
batch-size=1
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
#batched-push-timeout=33000
## Set muxer output width and height
#width=1920
#height=1080
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
#nvbuf-memory-type=0
## If set to TRUE, system timestamp will be attached as ntp timestamp
## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached
attach-sys-ts-as-ntp=1
# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b1gpu0_int8.engine
batch-size=32
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary.txt
[tests]
file-loop=0
Source1 is a rtsp stream with a resolution of 2560x1440;
Source2 is a rtsp stream with a resolution of 1920x1080;
Source3 is a rtsp stream with a resolution of 2048x1536
It ran well when I used old nvstreammumx, however, if I launched it with this:
export USE_NEW_NVSTREAMMUX="yes"
the memory would increase very fast, like from 3G to 16G in seconds, and would keep going up.