Unsolved QMediaContent video stream latency
-
Hello ,
I'm working on a robot model project. The robot communicates with my PC via Wifi, and an IP cam provides the video stream for the end-user. However I'm facing now with an issue that the video stream on my PC has 2-3 seconds delay, which is quite annoying.
My code snippet:
video_ablak = new QVideoWidget(this);
media_player = new QMediaPlayer(this, QMediaPlayer::LowLatency);
ui->video_layout->addWidget(video_ablak);
video_ablak->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);stream = QNetworkRequest(QUrl("rtsp://192.168.1.11:554/11 :network-caching=150"));
//stream.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
//stream.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false);ipcamera = new QMediaContent(stream);
media_player->setVideoOutput(video_ablak);
media_player->setMedia(*ipcamera);
media_player->play();In VLC media player I could achieve ~150-200 ms latency by reducing the network-caching to 150ms.
I tried the same in the link of the IP camera, but it has no effect. Neither the "setAttribute" parts in comment.
How could I reduce the network caching in Qt or how could I achive lower latency in the video stream?
(I wouldn't like to use the libVLC, because I have already a working mediaplayer in my software)