How to improve quality of rtsp stream without reducing latency and FPS in deepstream

• Hardware Platform: Jetson Orin Nano
• DeepStream Version: 7.1
• JetPack Version: 6.2
• TensorRT Version: TensorRT v100300
• NVIDIA GPU Driver Version (valid for GPU only): 540.4.0

Hi

how to reduce latency and increase FPS of rtsp stream without reducing quality in deepstream?

i have pipeline that supports RTSP stream and .MP4 input.

Are you using DeepStream as the RTSP server?

yes.

i used deepstream_test1_rtsp_in_rtsp_out.py as example

So what do you mean by “increase FPS of rtsp stream”? Are you talking about the processing FPS in the RTSP server side(the DeepStream app) or the playback FPS of the RTSP client side?

i mean When I run my pipeline, the rtsp stream fps is not exceeding 30, I’m thinking of increasing it above 30.

is possible to increasing fps without reducing latency and quality of rtsp stream?

FYI: I tried to reduce latency by adding “speed-preset” and “tune” properties to the software encoder and it worked but the RTSP stream quality dropped.

yes, playback FPS of the RTSP client side

python new_src/deepstream_test1_rtsp_in_rtsp_out_pose_roi.py -i file:///home/hbai/Documents/sky-metrics-ai/uploads/Full-second-half.mp4

Creating Pipeline
Creating streamux
Creating source_bin 0
Creating source bin source-bin-00
Creating preprocess
Creating YOLO-POSE inference engines (two PGIEs)
Creating tiler
Creating nvvidconv (pre-tiler)
Creating capsfilter for RGBA
Creating nvosd
Creating nvvidconv_caps
Creating caps filter
Creating Software H264 Encoder
Creating rtppay
Creating H264 rtppay
Creating udpsink
/home/hbai/Documents/sky-metrics-ai/new_src/deepstream_test1_rtsp_in_rtsp_out_pose_roi.py:419: Warning: value "4000000" of type 'guint' is invalid or out of range for property 'bitrate' of type 'guint'
  encoder.set_property("bitrate", int(bitrate))
Adding elements to Pipeline

*** YOLO-POSE DeepStream: Launched RTSP Streaming at rtsp://localhost:8512/pose-stream ***

Starting pipeline
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
0:00:00.319588723 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-hoop-ball-inference> NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 2]: deserialized trt engine from :/home/hbai/Documents/sky-metrics-ai/models/new_hoop_ball_detector.pt_fp16.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.319704535 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-hoop-ball-inference> NvDsInferContext[UID 2]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 2]: Use deserialized engine model: /home/hbai/Documents/sky-metrics-ai/models/new_hoop_ball_detector.pt_fp16.engine
0:00:00.326242019 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<primary-hoop-ball-inference> [UID 2]: Load new model:dstest1_pgie_config_sky.txt sucessfully
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
0:00:00.389551306 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-pose-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2092> [UID = 1]: deserialized trt engine from :/home/hbai/Documents/sky-metrics-ai/models/yolov8n-pose_fp16.engine
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0

0:00:00.389650094 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-pose-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2195> [UID = 1]: Use deserialized engine model: /home/hbai/Documents/sky-metrics-ai/models/yolov8n-pose_fp16.engine
0:00:00.391505009 2909710 0xaaaabbd86f20 INFO                 nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<primary-pose-inference> [UID 1]: Load new model:yolopose_config.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Decodebin child added: qtdemux0
Decodebin child added: multiqueue0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: aacparse0
Decodebin child added: avdec_aac0
Decodebin child added: nvv4l2decoder0
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
In cb_newpad
gstname= video/x-raw
features= <Gst.CapsFeatures object at 0xffffab0e9240 (GstCapsFeatures at 0xffff74035d80)>
In cb_newpad
gstname= audio/x-raw
DEBUG: FPS of stream source_1: current FPS 39.97 (average FPS 39.97)
DEBUG: FPS of stream source_1: current FPS 28.94 (average FPS 34.45)
DEBUG: FPS of stream source_1: current FPS 29.04 (average FPS 32.61)
DEBUG: FPS of stream source_1: current FPS 29.00 (average FPS 31.71)
DEBUG: FPS of stream source_1: current FPS 29.06 (average FPS 31.17)
DEBUG: FPS of stream source_1: current FPS 29.04 (average FPS 30.81)
DEBUG: FPS of stream source_1: current FPS 29.05 (average FPS 30.56)
...

What is the FPS of “Full-second-half.mp4”?

i think 30 fps

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/videos-for-test/Full-second-half.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2025-06-28T10:10:57.000000Z
  Duration: 00:05:20.33, start: 0.000000, bitrate: 5126 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 5004 kb/s, 30 fps, 30 tbr, 600 tbn (default)
    Metadata:
      creation_time   : 2025-06-28T10:10:57.000000Z
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
      encoder         : H.264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 117 kb/s (default)
    Metadata:
      creation_time   : 2025-06-28T10:10:57.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]

Please try to change the line 280 deepstream_python_apps/apps/deepstream-rtsp-in-rtsp-out/deepstream_test1_rtsp_in_rtsp_out.py at v1.2.0 · NVIDIA-AI-IOT/deepstream_python_apps to sink.set_property("sync", 0).

I set the sync to 0 but the stream quality has dropped significantly and there is glitching.

What kind of quality drop?What kind of glitching? Where and how did you playback the rtsp stream?

i think i fixed it thanks

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