Here is my code to get rtsp:
pipeline = "rtspsrc location={} latency=0 ! rtph265depay ! h265parse ! avdec_h265 ! videoconvert ! appsink".format(cam_adrs)
cap = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)
Then, I put every frame on a QLabel and use a QTimer to display:
ret, frame = cap.read()
if ret:
# transform format
img = QImage(frame, frame.shape[1], frame.shape[0], QImage.Format_RGB888)
pixmap = QPixmap.fromImage(img)
qlabel.setPixmap(pixmap)
It displayed with no delay, but not fluently, almost like stop-motion animation.
I played the rtsp by gst(using autovideosink). It’s fluent.
I‘ve tried 15fps、20、25,but not useful.
So,What are the possible causes and solutions?