I am having issues in rtsp streaming with opencv getting blurriness on the output frame

hi i have been working on a code which used rtsp url to stream frames in a pyqt5 application but the frames updated in pyqt5 gui …some blurriness is appearing on the frame generally when some vehicles are getting passed

those look like transmission errors, nothing to do with python, qt or gui

how do you acquire that stream ?
do you have control over the ip cam on the other side ?
(maybe a smaller resolution does the trick)

1 Like

yes in have access to that ip cam .one switch is connected with the ip camera .if i directly using the rtsp stream in vlc its not giving this error if i use normal code to stream rtsp using opencv generally not facing this issue as well. should i decrease the resolution to check the performance?

It definitely looks like your object detection is slowing down the speed that you can stream via rtsp. This is “probably” the most commonly asked question on the entire forum.

In a nutshell before @crackwitz looses his mind the best approach would be to stream in a separte thread to ensure that you can recieve the frames as fast as they are produced. Alternatives would be to lower the frame rate (increase the length of time you have to perform object detection) and/or the resolution (reduce the time taken to perform object detection).

The first thing to verify is that without the object detector everything works. Then try with the object detector but reducing the frame rate of the source and if that works use a separate thread.

3 Likes

definitely !

e.g. yolov5 works on 640x640 windows, transfering 1600x1200 pixels is a total waste …