Encoding problem RTSp stream

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4
• TensorRT Version 7.1
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• 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)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I am having problems with RTSP streamming when model is enabled and camera is moving, there are frames pixels not properly encoded and pixels distorted. Please check the image:

When model is disabled or interval is increased, corruption dissapears.

This is my config file:

[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

[source0]
enable=1
type=4
num-sources=1
uri=rtsp://root:usert@IP/axis-media/media.amp?videocodec=h264
gpu-id=0

[streammux]
gpu-id=0
batch-size=1
batched-push-timeout=-1
width=1280
height=720
enable-padding=1


[sink0]
enable=1
type=4
codec=1
sync=0
bitrate=4000000
rtsp-port=8554
udp-port=5400


[osd]
enable=1
gpu-id=0
border-width=2
text-size=12
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Arial
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0

[primary-gie]
enable=1
gpu-id=0
batch-size=1
gie-unique-id=1
interval=0
config-file=detector.txt

It seems to work without problems when I replace the source type from RTSP to URI

[source0]
enable=1
type=2
num-sources=1
uri=rtsp://root:usert@IP/axis-media/media.amp?videocodec=h264
gpu-id=0

Hi,
For RTSP soure(s), you can use type=2 or type=4. Please refer to the document:

It should be good if type=2 works fine.

Problem now is that type=2 adds a lot of delay… It’s far from real time processing

Hi,
Setting to type=2 uses uridecodebin. And setting to type=4 calls create_rtsp_src_bin() in deepstream_source_bin.c. The property is set in create_rtsp_src_bin():

g_object_set (G_OBJECT (bin->src_elem), "drop-on-latency", TRUE, NULL);

You may set it to FALSE for a try. Should not see bad frames if no frame is dropped.

And please refer to
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fclock_power_setup.html%23
We have power mode table for Jetson platforms. You may set to the max performance mode and execute sudo jetson_clocks.