Delay problem when capturing RTSP video

In my project, I need to process by capturing the RTSP broadcast with OpenCV. For this, I compiled openCV 4.5.4 to use gstreamer in the background (Windows). But when I capture the RTSP video with OpenCV, the delay is around 3-4 seconds. When I open it with the gst-launch-1.0 command, there is a delay of around 250-300ms.

gst-launch-1.0 -v rtspsrc latency = 30 location=rtspt://192.168.1.119:554 ! application/x-rtp, payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

or

gst-launch-1.0 -v rtspsrc latency = 0 location=rtspt://192.168.1.119:554 ! application/x-rtp, payload=96 ! rtph264depay ! h264parse ! nvh264dec ! videoconvert ! autovideosink sync=false

When I run it with commands, the delay is 250-300ms.

path =“rtspsrc latency = 30 location=rtsp://192.168.1.119:554 ! rtph264depay ! decodebin ! videoconvert ! appsink”;

or

path =“rtspsrc latency = 30 location=rtspt://192.168.1.119:554 ! application/x-rtp, payload=96 ! rtph264depay ! nvh264dec ! videoconvert ! appsink”;

VideoCapture cap(path,CAP_GSTREAMER);

But when I capture it with OpenCV and play it with imshow, there is an unacceptable amount of delay.

How can I solve this?