Adjust the latency of QML MediaPlayer (Qt6)
Unsolved
QML and Qt Quick
-
I'm trying to connect to an RTSP camera stream from QML using the MediaPlayer object. Using the code below, I can connect and stream, but there is significant latency (2-3 seconds). Sometimes, the stream starts with a very low latency, and I would like to make that behavior consistent. I have a wired connection to the camera module, so physical limitations on the latency should not be a problem.
import QtQuick import QtMultimedia Window { width: 1920 height: 1080 MediaPlayer { id: player source: "rtsp://xxxx" videoOutput: videoOut } VideoOutput { id: videoOut anchors.fill: parent } Component.onCompleted: player.play() }
I haven't found any resources that show how to adjust the latency of the MediaPlayer. If I manually connect to the rtsp stream using gstreamer, I can achieve a clean low-latency stream, so I know that it is possible.