问题排查#
如果您在使用 DeepStream 时遇到问题,请考虑以下解决方案。 如果您在下面找不到答案,请在 DeepStream 开发者论坛上发布您的问题。
您正在从 DeepStream 6.0 迁移到 DeepStream 7.1#
解决方案
您必须清理 DeepStream 6.0 库和二进制文件。 使用以下命令之一进行清理
对于 dGPU
例如,要移除 DeepStream 6.0
打开 uninstall.sh 文件,路径为
/opt/nvidia/deepstream/deepstream/
将
PREV_DS_VER
设置为 6.0以 sudo 权限运行脚本
./uninstall.sh
对于 Jetson:将目标设备刷写为最新版本的 JetPack。
推理#
当神经网络更改时,应用程序运行失败#
解决方案
确保为配置文件(例如 source30_720p_dec_infer-resnet_tiled_display_int8.txt
)中相应的 [GIE] 组更新了网络参数。 还要确保 Gst-nvinfer 插件的配置文件已相应更新。 当模型更改时,请确保应用程序没有使用旧的引擎文件。
性能#
DeepStream 应用程序运行缓慢(仅限 Jetson)#
解决方案
确保 Jetson 时钟设置为高频率。 运行以下命令以将 Jetson 时钟设置为高频率。
$ sudo nvpmodel -m 0 --for MAX perf and power
$ sudo jetson_clocks
DeepStream 应用程序运行缓慢#
解决方案 1
管道中的某个插件可能运行缓慢。 您可以测量管道中每个插件的延迟,以确定其中是否有插件运行缓慢。
要启用帧延迟测量,请在控制台上运行以下命令
$ export NVDS_ENABLE_LATENCY_MEASUREMENT=1
要启用所有插件的延迟测量,请在控制台上运行以下命令
$ export NVDS_ENABLE_COMPONENT_LATENCY_MEASUREMENT=1
解决方案 2:(仅限 dGPU)
确保您的 GPU 卡安装在总线宽度最高的 PCI 插槽中。
解决方案 3
在配置文件的 [streammux]
组中,将 batched-push-timeout
设置为 1/max_fps
。
解决方案 4
在配置文件的 [streammux]
组中,将宽度和高度设置为流的分辨率。
解决方案 5
对于 RTSP 流输入,在配置文件的 [streammux]
组中,设置 live-source=1
。 还要确保所有 [sink#] 组的 sync 属性都设置为 0。
解决方案 6
如果启用了辅助推理,请尝试在配置文件的 [secondary-gie#]
组中增加 batch-size,以防要推理的对象数量大于 batch-size 设置。
解决方案 7
在 Jetson 上,使用 Gst-nvdrmvideosink
而不是 Gst-nv3dsink
,因为 nv3dsink
需要 GPU 利用率。
解决方案 8
如果 GPU 是性能瓶颈,请尝试增加主检测器在输入帧上进行推理的间隔。 您可以通过修改应用程序配置中 [primary-gie] 组的 interval 属性,或 Gst-nvinfer 配置文件的 interval 属性来执行此操作。
解决方案 9
如果管道中的元素因缓冲区不足而变得饥饿(您可以检查 CPU/GPU 利用率是否较低),请通过在应用程序的 [source#] 组中设置 num-extra-surfaces
属性或 Gst-nvv4l2decoder
元素的 num-extra-surfaces
属性来增加解码器分配的缓冲区数量。
解决方案 10
如果您在 docker/控制台内运行应用程序,并且 FPS 较低,请在配置文件的 [sink0] 组中设置 qos=0
。 此问题是由初始负载引起的。 当 [sink0] 组中 qos 设置为 1(属性的默认值)时,decodebin 开始丢帧。
解决方案 11
对于 RTSP 流输入,如果输入抖动较高,则 GStreamer rtpjitterbuffer
元素可能会丢弃延迟到达的数据包。 增加 rtspsrc
的 latency 属性,对于 deepstream-app
,在 [source*] 组中设置 latency
。 或者,如果将 RTSP 类型源(type=4)与 deepstream-app
结合使用,请在 deepstream_source_bin.c
中关闭 drop-on-latency
。 这些步骤可能会增加帧到达渲染器的累积延迟,并在管道速度不够快时导致 rtpjitterbuffer
中内存累积。
解决方案 12
在 Jetson 上,在 gst-nvinfer 的配置文件中设置 scaling-compute-hw = 1
(如果 GPU 使用率不是 100%)。
解决方案 13
在 dgpu 上,在 Gst-nvv4l2decoder 插件上设置 cudadec-memtype=0
属性以选择设备内存输出。
Triton#
当 deepstream-app 无法加载插件 Gst-nvinferserver 时发生错误#
例如: (deepstream-app:16632): GStreamer-WARNING **: 13:13:31.201: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so':
libtrtserver.so: cannot open shared object file: No such file or directory.
这是一个无害的警告,表明 DeepStream 的 nvinferserver
插件无法使用,因为未安装 “Triton Inference Server”。
解决方案 1
如果用户不需要 Triton 支持,请忽略此消息。 否则,请参阅解决方案 2、3。
解决方案 2
拉取 deepstream-triton
docker 镜像并启动容器。 重试 deepstream-app
以启动 triton 模型。
解决方案 3
对于 dGPU:从源代码 (triton-inference-server/server) 构建 Triton 服务器库,并手动修复动态链接问题。
对于 Jetson:请参阅
/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app-triton/README
,了解在 Jetson 上安装 Triton 的步骤。
Tensorflow 模型遇到 OOM(内存不足)问题#
此问题可能会表现为其他错误,例如 CUDA_ERROR_OUT_OF_MEMORY
、core dump
、application get killed
(一旦 Tensorflow 组件设置了 GPU 内存)。
解决方案
在配置文件(例如 config_infer_primary_detector_ssd_inception_v2_coco_2018_01_28.txt
)中调整参数 tf_gpu_memory_fraction
为适当的值。 有关更多详细信息,请参阅:samples/configs/deepstream-app-triton/README
。
跟踪器设置和参数调整中的问题排查#
Bbox 闪烁#
如果 PGIE 检测间隔设置为零(即 ds-app 配置文件中的 interval=0
),并且 minTrackerConfidence
的值设置得太低,则视频输出中可能会出现 bbox 闪烁。 尝试增加此参数的值以缓解此问题。
如果 PGIE 检测间隔设置为非零值(即 ds-app 配置文件中的 interval
> 0),则预期跟踪器输出不会在未推理的帧上报告,尽管所有目标都在后台被跟踪。 因此,OSD 的实时视频显示具有 bbox 闪烁是预期行为。
为了缓解此问题,用户可以首先启用过去帧数据配置以检索错过的输出,然后添加自定义模块以将实时元数据与过去帧数据组合。 这样,用户可以按正确的顺序组合数据,并可以选择可视化显示在显示器上的组合数据,而不会出现 bbox 闪烁问题。
频繁的跟踪 ID 更改,即使附近没有对象#
这可能是因为跟踪器无法从相关性响应图中检测到目标。 建议从较低的目标最小资格开始。 首先,将 minTrackerConfidence
设置为相对较低的值,如 0.5
。 此外,如果启用了状态估计器,则预测可能不够准确。 用户可以根据预期的运动动力学调整状态估计器参数,或者在调试期间禁用它。
频繁的跟踪 ID 切换到附近的物体#
通过增加最小资格(例如)来使数据关联策略更严格
minMatchingScore4SizeSimilarity
minMatchingScore4Iou
minMatchingScore4VisualSimilarity
设置 Re-ID 模型#
使用 config_tracker_NvDCF_accuracy.yml
或 config_tracker_NvDeepSORT.yml
时出现错误 “!![ERROR] TAO model file does not exist”。 tltEncodedModel: "/opt/nvidia/deepstream/deepstream/samples/models/Tracker/resnet50_market1501.etlt""
不存在。
解决方案
您需要 Re-ID 模型才能使用这些跟踪器。 请按照 sources/tracker_ReID/README
中的步骤设置 Re-ID 模型。
运行 ONNX / 显式批次维度网络时出错#
在 Jetson 上升级 TensorRT 后,运行 ONNX / 显式批次维度网络失败,并出现错误 “Network has dynamic or shape inputs, but no optimization profile has been defined.”。
由于 TensorRT 7.1.3.0(Jetpack 4.4 - Jetpack 4.6 的一部分)中存在 ABI 中断,因此在迁移到较新 TensorRT 版本时,需要从 SDK 中提供的源代码重新编译 libnvds_infer.so
。 源代码以及编译说明可在 /opt/nvidia/deepstream/deepstream-6.4/sources/libs/nvdsinfer
中找到。
警告消息 gstnvtracker: Unable to acquire a user meta buffer
#
跟踪器使用缓冲区池进行杂项数据内存管理,其大小可以使用 user-meta-pool-size
设置。 当下游插件释放缓冲区的延迟过长时,缓冲区池可能为空,因此跟踪器将跳过报告下一批的杂项数据并打印此消息。 用户可以将池大小从默认值 32 增加到更大的值,如 64。
Graph Composer 问题排查#
即使已向注册表注册扩展,我的组件在 composer 中仍然不可见#
运行 “registry extn info -n <extn-name>” 以检查组件是否是扩展的一部分。
如果不是,请检查是否已在扩展的 GXF_EXT_FACTORY 代码块内添加了对应于组件的 GXF_EXT_FACTORY_ADD() 调用
运行 “registry comp info -t <comp-type>” 以检查组件是否被检测为抽象类型。
如果是,则组件不会列出抽象类型,因为它们无法实例化。 查看下一个问题的解决方案。
我的组件被注册为抽象类型。#
这通常是因为未实现从基类层次结构继承的纯虚方法。 查找哪些纯虚方法未实现的快速方法是尝试声明组件类的对象。 在类定义之后的任何位置添加 “MyComponentType comp;” 都应抛出指向缺少实现的编译错误。
执行图时,执行立即结束,并显示警告 “No system specified. Nothing to do”#
检查 NvDsScheduler 组件是否是图的一部分。
其他#
运行 DeepStream 管道时出现 “NvDsBatchMeta not found for input buffer” 错误#
解决方案
管道中没有 Gst-nvstreammux 插件。 从 DeepStream 4.0 开始,Gst-nvstreammux 是必需的插件。 这是一个示例管道
Gst nvv4l2decoder --> Gst nvstreammux --> Gst nvinfer --> Gst nvtracker --> Gst nvmultistreamtiler --> Gst nvvideoconvert --> Gst nvosd --> Gst nveglglessink
DeepStream 参考应用程序启动失败,或任何插件加载失败#
解决方案
尝试通过运行以下命令清除 GStreamer 缓存
$ rm -rf ${HOME}/.cache/gstreamer-1.0
如果加载任何插件时出现问题,也请运行此命令。 终端上会显示插件失败的警告或错误。
$ gst-inspect-1.0
然后运行以下命令以查找缺少的依赖项
$ ldd <plugin>.so
其中 <plugin> 是加载失败的插件的名称。
当 deepstream-app 运行的流数量大于 100 时发生错误#
例如: (deepstream-app:15751): GStreamer-CRITICAL **: 19:25:29.810: gst_poll_write_control: assertion 'set != NULL' failed.
解决方案
在控制台上运行以下命令
`` ulimit -Sn 4096``
然后再次运行 deepstream-app
。
从管道中移除所有源后,如果管道中存在 muxer 和 tiler,则会看到崩溃#
当 muxer 生成一个空批处理缓冲区以清除 tiler 输出时,会发生这种情况。 要解决此问题,请在 tiler 的 sink pad 上安装一个 probe。 如果 batch_meta->num_frames_in_batch = 0,则丢弃缓冲区,参考代码片段如下
static GstPadProbeReturn drop_empty_buffer (GstPad * pad,
GstPadProbeInfo * info,
gpointer user_data) {
NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(GST_BUFFER(info->data));
if (batch_meta && batch_meta->num_frames_in_batch == 0)
return GST_PAD_PROBE_DROP;
return GST_PAD_PROBE_OK;
}
GstPad *sinkpad = gst_element_get_static_pad(tiler, "sink");
gst_pad_add_probe(sinkpad, GST_PAD_PROBE_TYPE_BUFFER, drop_empty_buffer,
NULL, NULL);
gst_object_unref(sinkpad)
某些 RGB 视频格式管道在 DeepStream 6.1 之前在 Jetson 上工作,但现在无法工作#
以下管道过去在 DeepStream 6.1 之前的版本中工作,并且在 dGPU 上也工作,但在 Jetson 上失败
gst-launch-1.0 -v videotestsrc ! 'video/x-raw,format=RGB' ! videoconvert ! \
nvvideoconvert nvbuf-memory-type=0 name=converter1 ! 'video/x-raw(memory:NVMM),format=(string)NV12' ! \
nvvideoconvert ! 'video/x-raw' ! nveglglessink
Setting pipeline to PAUSED ...
Using winsys: x11
Pipeline is PREROLLING ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvideoconvert:converter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstEglGlesSink:eglglessink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:converter1.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
0:00:00.282672495 716265 0xaaab033c7400 ERROR nvvideoconvert gstnvvideoconvert.c:3750:``gst_nvvideoconvert_transform: buffer transform failed``
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
nvvideoconvert 在 DeepStream 6.1 中添加了对 RGB/BGR 视频格式的支持。 早期 nvvideoconvert 不接受 RGB/BGR 输入,因此对于上述管道,(OSS) videoconvert 将 RGB 转换为 nvvideoconvert 可以接受的格式,因此它可以工作。 现在,在 DeepStream 6.1 之后,(OSS) videoconvert 插件进入直通模式,Jetson 的默认计算硬件是 VIC,它不支持 RGB 输入。 要允许 RGB 输入和输出与 nvvideoconvert 一起工作,请在插件上设置 compute-hw=GPU
属性,如下所示。
gst-launch-1.0 -v videotestsrc ! 'video/x-raw,format=RGB' ! videoconvert ! \
nvvideoconvert compute-hw=GPU nvbuf-memory-type=0 name=converter1 ! 'video/x-raw(memory:NVMM),format=(string)NV12' ! \
nvvideoconvert ! 'video/x-raw' ! nveglglessink
Setting pipeline to PAUSED ...
Using winsys: x11
Pipeline is PREROLLING ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvideoconvert:converter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstEglGlesSink:eglglessink0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter2.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)NV12, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:converter1.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
UYVP 视频格式管道在 Jetson 上无法工作#
以下 UYVP 视频格式管道在 Jetson 上无法工作
gst-launch-1.0 videotestsrc ! 'video/x-raw,format=UYVP,width=1920,height=1080,depth=10,framerate=(fraction)50/1' ! nvvideoconvert ! \
'video/x-raw(memory:NVMM),width=960,height=540,format=UYVP' ! nvvideoconvert ! nv3dsink -v
Setting pipeline to PAUSED ...
Using winsys: x11
Pipeline is PREROLLING ...;
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420, block-linear=(boolean)false
/GstPipeline:pipeline0/GstNv3dSink:nv3dsink0.GstPad:src: caps = video/x-raw, width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)RGBA, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0.GstPad:sink: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
nvbufsurface: invalid colorFormat 69
nvbufsurface: Error in allocating buffer
Error(-1) in buffer allocation
** (gst-launch-1.0:723645): CRITICAL **: 17:18:46.766: gst_nvds_buffer_pool_alloc_buffer: assertion 'mem' failed
ERROR: from element /GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0: failed to activate bufferpool
Additional debug info:
gstbasetransform.c(1678): default_prepare_output_buffer (): /GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0:
failed to activate bufferpool
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Jetson 上的默认内存分配器 (nvbuf-mem-surface-array)
不支持 UYVP 的分配,因此目前仅支持通过 Jetson 上的 nvbuf-mem-cuda-device
进行分配。 由于 VIC 不支持在 Cuda 内存上进行转换,因此可以使用 GPU 来完成所需的转换。 因此,可以修改上述管道以在 Jetson 上运行。
gst-launch-1.0 videotestsrc ! 'video/x-raw,format=UYVP,width=1920,height=1080,depth=10,framerate=(fraction)50/1' ! \
nvvideoconvert nvbuf-memory-type=nvbuf-mem-cuda-device compute-hw=GPU ! \
'video/x-raw(memory:NVMM),width=960,height=540,format=UYVP' ! nvvideoconvert compute-hw=GPU ! nv3dsink -v
Setting pipeline to PAUSED ...
Using winsys: x11
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420, block-linear=(boolean)false
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420, block-linear=(boolean)false
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)I420, block-linear=(boolean)false
/GstPipeline:pipeline0/GstNv3dSink:nv3dsink0.GstPad:sink: caps = video/x-raw, width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)RGBA, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)960, height=(int)540, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, format=(string)UYVP, block-linear=(boolean)false
/GstPipeline:pipeline0/Gstnvvideoconvert:nvvideoconvert0.GstPad:sink: caps = video/x-raw, format=(string)UYVP, width=(int)1920, height=(int)1080, framerate=(fraction)50/1, multiview-mode=(string)mono, depth=(int)10, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
注意
原始管道在 dGPU 上可以按原样工作,但需要修改它以移除 nvegltransform 元素。
当源是长时间的容器化文件(例如 mp4、mkv)时,内存使用量持续增加#
GStreamer 的 Base Parse 类中存在内存累积错误,这可能会影响 GStreamer 提供的所有编解码器解析器。 仅在长时间可搜索流(主要是容器化文件,例如 mp4)中看到此错误。 这不会影响 RTSP 等实时源。 已在 GStreamer 的 GitLab 项目 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/468 上提交了一个问题
解决方案
将以下临时修复应用于 GStreamer 源代码并构建库。
检查系统上安装的确切 Gstreamer 版本。
$ gst-inspect-1.0 --version gst-inspect-1.0 version 1.16.2 GStreamer 1.16.2 https://launchpad.net/distros/ubuntu/+source/gstreamer1.0
克隆 Gstreamer 仓库并签出与已安装版本对应的标签。
$ git clone git@gitlab.freedesktop.org:gstreamer/gstreamer.git $ cd gstreamer $ git checkout 1.16.2
确保已安装构建依赖项。
$ sudo apt install libbison-dev build-essential flex debhelper
运行
autogen.sh
和 configure 脚本。
$ ./autogen.sh –noconfigure $ ./configure –prefix=(pwd)/out # Don’t want to overwrite system libs
将以下补丁保存到文件中。
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 41adf130e..ffc662a45 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1906,6 +1906,9 @@ gst_base_parse_add_index_entry (GstBaseParse * parse, guint64 offset, GST_LOG_OBJECT (parse, "Adding key=%d index entry %" GST_TIME_FORMAT " @ offset 0x%08" G_GINT64_MODIFIER "x", key, GST_TIME_ARGS (ts), offset); + if (!key) + goto exit; + if (G_LIKELY (!force)) { if (!parse->priv->upstream_seekable) {
应用补丁。
$ cat patch.txt | patch -p1
构建源代码。
make -j(nproc) && make install
8. 备份发行版提供的库并复制新构建的库。 调整库名称以适应版本。 对于 Jetson,将 x86_64-linux-gnu 替换为 aarch64-linux-gnu。
$ sudo cp /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0.1602.0 ${HOME}/libgstbase-1.0.so.0.1602.0.backup $ sudo cp out/lib/libgstbase-1.0.so.0.1602.0 /usr/lib/x86_64-linux-gnu/
在 RTSP 输出上观察到陈旧帧#
如果在 RTSP 输出上观察到陈旧帧,请更新用于运行 deepstream 应用程序的配置文件中的 rtsp-port 和 udp-port 参数(在 RTSP sink 中)。
将 rtsp-port 更新为其他端口号。 例如:rtsp-port=8660
将 udp-port 更新为其他端口号。 例如:udp-port=5500
由于通过远程查看 RTSP 输出(使用 VLC)时可能发生数据包丢失,因此看到毛刺/视频卡顿#
VLC 默认使用 UDP 来流式传输 RTSP URL。 UDP 是有损的,并且会在渲染的视频上造成质量问题。
远程查看 DeepStream RTSP sink 输出时,请强制使用 TCP 以避免不必要的数据包丢失。
强制 VLC 使用 TCP 的示例命令
$ vlc --rtsp-tcp rtsp://path/to/stream
启动 DS docker 时,DeepStream 插件无法加载,并且未设置 DISPLAY 变量#
解决方案
如果用户确保满足以下任一要求,则错误 “No EGL Display; nvbufsurftransform: Could not get EGL display connection” 将会解决。 以下要求应在使用 docker run
命令启动 docker 之前满足。
当用户希望使用显示窗口时
为
DISPLAY
变量设置适当的值,并且从主机终端执行命令:
xhost +
,以允许 docker 启动显示窗口。
示例
$ export DISPLAY=:0 $ xhost +
当用户不希望使用显示窗口时
取消设置
DISPLAY
变量,或者启动 docker 时,不要将其
DISPLAY
变量导出到其环境。
Nvidia 驱动程序安装问题#
错误:“An NVIDIA kernel module ‘nvidia-drm’ appears to already be loaded in your kernel. ****”
解决方案
此错误表明已加载另一个版本的 NVIDIA 驱动程序。 您可以参考以下链接卸载以前的驱动程序版本。 卸载方法因安装方法(runfile 或 debian)而异。
快速链接
在 Jetson 上,观察到错误:gstnvarguscamerasrc.cpp, execute:751 No cameras available#
为了访问 CSI 摄像头,您可以使用 Jetson-IO 工具启用 CSI 摄像头传感器。
例如,在 AGX 上,导航到 /opt/nvidia/jetson-io/
-> 运行 sudo python jetson-io.py 并按照向导 -> 配置 Jetson AGX Xavier CSI 连接器 -> 配置兼容硬件。 -> 选择 CSI 摄像头模块,例如 “Jetson Camera E3333 module” -> 保存引脚更改 -> 保存并重启以重新配置引脚
有关更多详细信息,请参阅 https://docs.nvda.net.cn/jetson/l4t/#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html 以及 https://developer.nvidia.com/sites/default/files/akamai/embedded/jetson-linux-release-notes-r341-dp.pdf 的 2.3 和 3.0 节
在 Jetson 上,观察到错误:“nvbufsurftransform_copy.cpp: Failed in mem copy” 或 “cuGraphicsEGLRegisterImage failed : 700”#
为了避免此错误,我们可以将 “copy-hw” 属性设置为 “VIC”,以便在使用 “nvbuf-mem-surface-array” 作为内存类型时用于 nvvideoconvert。
将 nvvideoconvert 的 “copy-hw” 属性设置为 “VIC” 的示例管道
$ gst-launch-1.0 filesrc location=test_I420.yuv ! videoparse width=1280 height=720 format=2 framerate=30/1 ! nvvideoconvert copy-hw=2 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nv3dsink sync=0 -e
有关从应用程序使用 “copy-hw” 属性的信息,请参阅 Deepstream SDK 中提供的 “deepstream-appsrc-test” 应用程序。
注意
有关更多常见问题解答和问题排查,请参阅 https://forums.developer.nvidia.com/t/deepstream-sdk-faq/