DeepStream Pipeline Performance Issues

I am having some trouble with my deepstream pipelilne’s performance, it is dropping frames and running at less 40% video speed (20 fps vs 50 fps) of the source .mp4

Some general specs

wsl2
container: nvcr.io/nvidia/deepstream:7.1-triton-multiarch
RTX 5000 Ada Laptop config dGPU
Intel i9-13900
64 GB RAM

Pipeline Elements
source = Gst.ElementFactory.make(“filesrc”, “file-source”)
demuxer = Gst.ElementFactory.make(“qtdemux”, “demuxer”)
parser = Gst.ElementFactory.make(“h264parse”, “parser”)
decoder = Gst.ElementFactory.make(“nvv4l2decoder”, “decoder”)
streammux = Gst.ElementFactory.make(“nvstreammux”, “stream-muxer”)
videoconvert = Gst.ElementFactory.make(“nvvideoconvert”, “video-convert”)
capsfilter = Gst.ElementFactory.make(“capsfilter”, “capsfilter”)
fpssink = Gst.ElementFactory.make(“fpsdisplaysink”, “fps-sink”)

Broadly, i am decoding .mp4 files, parsing and decoding the video element, batching frames, and converting to RGBA. The goal is to inference using TRT, however the pipeline isnt fast enough yet.

Here are the logs confirming successful pipeline init, as well as fpssink output

2025-01-14 16:33:27,482 - INFO - Starting pipeline…
2025-01-14 16:33:27,482 - INFO - Creating pipeline…
2025-01-14 16:33:27,495 - INFO - Decoder source pad successfully linked to streammux sink pad.
2025-01-14 16:33:27,496 - INFO - Added frame resolution probe to parser source pad.
2025-01-14 16:33:27,496 - INFO - Added frame resolution probe to streammux source pad.
2025-01-14 16:33:27,496 - INFO - Added frame resolution probe to nvvideoconvert source pad.
2025-01-14 16:33:30,135 - INFO - Pipeline is now playing.
2025-01-14 16:33.91,022 - INFO - FPS: 17.984607801474674, Drop Rate: 41.96408487010758, Avg FPS: 19.537428788172342
Everything has in

What can I investigate to improve performance? All source and sinks are configured with correct formats and compatibilities, and I’m really not sure how to improve performance from here. Script provided below

DS script.txt (6.6 KB)

  • 1.You can try to run your pipeline with gst-launch-1.0 filesource .... ! demux ...! parser... ! decoder... ! ... command to check the fps first. You can complete the command according to the pipeline you are using in your code.

    1. Please adjust the parameters of nvstreammux as follows
    streammux.set_property("batch-size", <source_number>)
    streammux.set_property("width", <video_width>)
    streammux.set_property("height", <video_height>)
    streammux.set_property("batched-push-timeout", 20000) #20ms
    streammux.set_property("live-source", 0)
...
    fpssink.set_property("sync", 0)
...
    1. Could you attach your M50FR_SF1_AW_FF.mp4 video so that we can try that on our side? I have tried your code with our 1080p h264 sample video on the RTX 5000 GPU, the fps is as follows.
2025-01-17 07:17:51,960 - WARNING - Pad already linked.
2025-01-17 07:17:53,582 - INFO - FPS: 559.3107445901193, Drop Rate: 0.0, Avg FPS: 559.3107445901193
2025-01-17 07:17:54,083 - INFO - FPS: 682.5655393742861, Drop Rate: 0.0, Avg FPS: 620.9648819690368
2025-01-17 07:17:54,583 - INFO - FPS: 731.3422965592812, Drop Rate: 0.0, Avg FPS: 657.7385510908865
2025-01-17 07:17:55,084 - INFO - FPS: 692.9868975070061, Drop Rate: 0.0, Avg FPS: 666.550973389251
nvstreammux: Successfully handled EOS for source_id=0

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