RTSP stream from Deepstream is buffering every 3 seconds in VLC

• Hardware Platform (Jetson Nano)
• DeepStream Version*deepstream-l4t 5.0.1-20.09-samples
• JetPack Version (4.5)
• TensorRT Version*7.1.3.0
• Issue Type( questions)

Hi guys,

I have a problem wth rtsp streams create by the deepstream-app. I can access the rtsp stream on my Windows10 Notebook with the VLC Player and SMPlayer. The Problem is that the stream is buffering every 3 to 4 seconds.
Changing the bitrate didn’t solve the problem. Only the video quality is much worse.

Maybe someone has an idea how to get rid of the buffering.

I use the following pipeline:

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[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
type=3
uri=file://…/…/streams/testfahrt1.mp4
num-sources=1
#drop-frame-interval=2
gpu-id=0
cudadec-memtype=0

[sink0]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File
type=2
sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=0
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
#iframeinterval=10
bitrate=4000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
output-file=out.mp4
source-id=0

[sink2]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=4
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
#iframeinterval=10
bitrate=400000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
rtsp-port=8554
udp-port=5400

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

[streammux]
gpu-id=0
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=-1
width=640
height=360
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
model-engine-file=…/…/models/mobilenetv2_4classes/model.engine
batch-size=1
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=255;100;20;1
bbox-border-color2=255;0;0;1
bbox-border-color3=0;128;0;1
bbox-border-color4=255;255;0;1
interval=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_ssd.txt

[tests]
file-loop=0

You can use “tegrastats” command to measure the GPU loading when you run your case. If the GPU loading is low, the problem may related to network.

Thank you for the reply @Fiona.Chen.
The GPU clock is all the time at maximum 921 MHz and the GPU usage jumps between 90 and 99%. Because of that i would say the network isn’t the Problem. When I don’t use a rtsp sink then I get a video without buffering. I also connected the Nano directly via an ethernet cable to the notebook but the buffering still exists.

Update:
If I use a live-source (Webcam) I don’t encounter the unwanted buffering anymore.
I also checked with another video file (streams/sample_720p.mp4), still the same buffering problem.

You need to set “batched-push-timeout=33000” in [streammux] group.