QtMultimedia - UI Freezes after 6.4.0 update.
-
Hi all,
Since I updated Qt 6.2.4 to 6.4.0 (which fixes QTBUG-105344) my application seems slower and in some cases it freezes all the UI.The application is a kind of video player, I am currently using MPG files (mpeg-1/2), but also tested .AVI. (I don't think these matters)
After start the playback it freezes for a while (5-10 seconds, or more), sometimes it goes back to normal, but sometimes I need to terminate the process.
It also seems slower when jump to a point of the video by doing QMediaPlayer::setPosition.I already tested the Qt example “Media Player Example” and it seems normal while running any video format.
Anyone having the same issue or something similar??
Thanks.
-
Hi,
What is different between the Qt example and your application from a Qt multimedia point of view ?
-
Hi SGaist, thanks for the fast replay.
A lit bit confuse , but...
I have a QGraphicsView and inside my QGraphicsScene I have the QGraphicsVideoItem, and then I send the video output to it (m_player->setVideoOutput( videoItem );).*I am currently using QGraphicsView because I need to rotate de video.
The freeze occurs only after start the playback.
I already tried to disable some features like the eventFilter which set the QToolTip by passing the mouse through, but nothing works. It is really strange because in 6.2.4 works well, I had never seen this problem. Maybe the playback mechanism has changed in this new version?
-
Can you check with Qt 6.3 ?
-
You should open a bug report and provide a minimal compilable example that shows the freeze.
As a workaround, you can build the qtmultmedia from your 6.3 sources (only this module, no need to build anything else) with the patch you need added on top of it.
-
Ok @SGaist, I am currently trying this workaround, I will let you know what I got.
Thanks. -
@SGaist, I was able to make the workaround possible. The video is rewinding normally, but I needed to convert my mpeg1/2 video to mp4|avi, using MPG it crashes.
Thank you.
-
Which platform are you on ?
-
Do you have the same issue if you play the video with gstreamer directly ?
-
No, only in my code.
-
Then it's something you should report.
-
Just to add that I have noticed similar behaviour with Sonic Pi (https://github.com/sonic-pi-net/sonic-pi).
After upgrading Qt to 6.4, the app freezes at some point. It appears non-deterministic - sometimes after minutes, another time after an hour or so.
Downgrading to Qt 6.3.2 didn't fix the issue either - my guess is that whatever is causing the issue is new to 6.3.2 and 6.4.
Downgrading to Qt 6.2.4 does appear to have fixed the issue. I've had the GUI running overnight and all morning and no freezing so far.
I should also note that I've been working on Sonic Pi from the very first Qt 5.x releases for 10 years now and this has been the first time I've seen such freezing.
-
Update:
Unfortunately, I couldn't fix the freeze by using Qt 6.4, but that workaround worked with Qt 6.3.2 and 2.4.0.
About the rewind problem, I was finally able to run without crashes. So, the final solution for me:
Fedora 36 (KDE Plasma 5.25.5) - kernel 5.19.15
Gstreamer backend 1.20.3
Qt 6.3.2 (plus qtmultimedia workaround)And I forgot to mention, the freeze also appears in Qt 6.3.2 if using Wayland as window manager.
-
So I insist: open a bug report :-) Both of you have solid evidence that something is amiss so don't hesitate.
-
@Sam-Aaron said in QtMultimedia - UI Freezes after 6.4.0 update.:
Downgrading to Qt 6.2.4 does appear to have fixed the issue. I've had the GUI running overnight and all morning and no freezing so far.
Unfortunately (for me) this assertion was wrong and I got a freeze with a Qt 6.2.4 build. Apologies for the red herring - my issue is likely unrelated.