How to configure ds-app to save data to redis?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.1
• JetPack Version (valid for Jetson only)
• TensorRT Version 8.2.5-1+cuda11.4
• NVIDIA GPU Driver Version (valid for GPU only) 510.68.02
• Issue Type( questions, new requirements, bugs) questions
• 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) export NVDS_ENABLE_LATENCY_MEASUREMENT=1
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi, i encounter a question and need some help. I want to save the infer data to redis use the ds-app. But when i configure sink type = 6 , the redis server does not have any data. I exec netstat and found it can establish with the redis server. Here is my configure txt:

The txt is :
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=0
rows=1
columns=1
width=1280
height=720
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP 5=CSI
type=4
#uri=file:/opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_1080p_h264.mp4
uri=rtsp://admin:zhy12345@172.16.72.64:554/Streaming/Channels/101
#uri=rtmp://192.168.0.14:1935/live/live999
num-sources=1
gpu-id=0
cudadec-memtype=0
[source1]
enable=0
type=3
uri=file:/opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_qHD.mp4
#uri=rtmp://192.168.0.14:1935/live/live999
#uri=rtsp://172.16.80.161:554/live/main_stream
num-sources=1
gpu-id=0
cudadec-memtype=0

[source2]
enable=0
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP 5=CSI
type=3
uri=file:/opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_ride_bike.mov
#uri=rtmp://192.168.0.14:1935/live/live999
#uri=rtsp://172.16.80.161:554/live/main_stream
num-sources=1
gpu-id=0
cudadec-memtype=0

[source3]
enable=0
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP 5=CSI
type=3
uri=file:/opt/nvidia/deepstream/deepstream-6.1/samples/streams/sample_1080p_h265.mp4
#uri=rtmp://192.168.0.14:1935/live/live999
num-sources=1
gpu-id=0

cudadec-memtype=0

[sink0]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=Overlay 8=rtmpStreaming
type=8
source-id=0
#Indicates how fast the stream is to be rendered. 0: As fast as possible 1: Synchronously
sync=0
gpu-id=0
nvbuf-memory-type=0
codec=1
enc-type=0
qos=0
bitrate=4000000
iframeinterval=30
#rtsp-port=8857
#udp-port=5400
rtmp-address=192.168.0.87
rtmp-port=26666
[sink4]
enable=1
sync=0
type=6
source-id=0
new-api=0
msg-broker-proto-lib=/opt/nvidia/deepstream/deepstream-6.1/lib/libnvds_redis_proto.so
msg-broker-conn-str=127.0.0.1;36379
topic=yolo-meta
msg-conv-config=/home/share/deepstream-6.1/sources/apps/sample_apps/deepstream-test4/dstest4_msgconv_config.txt
msg-conv-payload-type=0

[sink1]
enable=1
type=4
source-id=1
sync=0
gpu-id=0
nvbuf-memory-type=0
codec=1
enc-type=0
qos=0
bitrate=4000000
iframeinterval=30
rtsp-port=8858
udp-port=5401

[sink2]
enable=1
type=1
source-id=2
sync=0
gpu-id=0
nvbuf-memory-type=0
codec=1
enc-type=0
qos=0
bitrate=4000000
iframeinterval=30
rtsp-port=8859
udp-port=5402

[sink3]
enable=1
type=1
source-id=3
sync=0
gpu-id=0
nvbuf-memory-type=0
codec=1
enc-type=1
qos=0
bitrate=4000000
iframeinterval=30
rtsp-port=8860
udp-port=5403

[osd]
enable=1
gpu-id=0
border-width=5
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0
opencv_img_save=0
save_interval=10
save_img_path=/home/share/

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=1
batch-size=4
##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=40000
##Set muxer output width and height
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=4
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_yoloV5.txt

[tests]
file-loop=1

There is another problem , when i enable sink0 and sink4 . Ds-app cannot create pipeline .

(deepstream-app:23790): GStreamer-CRITICAL **: 10:23:13.677: gst_bin_add: assertion ‘GST_IS_ELEMENT (element)’ failed
** ERROR: <create_pipeline:1327>: create_pipeline failed
** ERROR: main:697: Failed to create pipeline
Quitting
App run failed

Ds-test4 can send data to redis correctly.

  1. could you share the Ds-test4 configuration file that can work?
  1. need more logs, please do “export GST_DEBUG=4”, then run again.
  1. In Ds-test4, i just run the command
    “./deepstream-test4-app -i …/…/…/…/samples/streams/sample_720p.h264 -p /opt/nvidia/deepstream/deepstream-6.1/lib/libnvds_redis_proto.so --conn-str=“127.0.0.1;36379” -t yolo-meta -s 0 --no-display”, it can send data to redis.
  2. when i make clean and make , the error clean. --!
    but cannot send data to redis ,i export GST_DEBUG=4 and save the log. I cannot found any problem, i enable sink0 and sink4, it can see the stream output by ds-app via vlc , but can`t send data to redis even the topic not be created.
    deepstream-app.log (1.3 MB)
  1. are you testing deepstream-app? first the configuration file needs to include nvmsgconv and nvmsgbroker 's configuration, please refer to test5_config_file_src_infer.txt, second you need to need to generate event message meta in code, please refer to generate_event_msg_meta of osd_sink_pad_buffer_probe in deepstream_test4_app.c.
  2. nvmsgconv and nvmsgbroker are opensource, you can add logs to check if the data is generated and sent, the path is opt\nvidia\deepstream\deepstream\sources\gst-plugins\gst-nvmsgconv\gstnvmsgconv.c, opt\nvidia\deepstream\deepstream\sources\gst-plugins\gst-nvmsgbroker\gstnvmsgbroker.cpp
  1. I refer to ds-test4, and add NvDsUserMeta to NvDsFrameMeta in the osd sink bin. I add extra log in gstnvmsgconv.c , found the user_meta_list is empty , this lead to the msgconv cannot generate payload. Here is the code place:

    Next, how can i solve this problem?

I found add user meta in the osd sink pad is not suitable, because the msgconv and the osd run different branches, it makes no influence that creates in the osd sink pad。


So i refer the ds-test5 to make a bbox_generated_probe_after_analytics, and add it in the create_pipeline function,it works.

Glad to know you fixed it, thanks for the update! If need further support, please open a new one. Thanks

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