[BUG] Issues with QMediaPlayer after PyQt6-Qt6 v6.6.3 (v6.7.0 included)

Gdaliy Garmiza gdalik at gmail.com
Sun May 5 16:22:23 BST 2024


Hello!

I have developed a Free and Open-Source app which uses PyQt6 for GUI,
including the extensive use of QtMultimedia/QMediaPlayer for playing audio
files.
It is called EarQuiz Frequencies, and the codebase is available here:
https://github.com/Gdalik/EarQuiz_Frequencies
I tried to upgrade to PyQt6 v6.6.3, and then to the latest version 6.7.0,
but this resulted in buggy behavior of QMediaPlayer, especially on Windows!
My app lets a user switch the audio backend from GUI. This setting is
stored in the 'config.ini' file, and the required backend is activated
after launching/restarting the program.

Here is what I get on different platforms as results of manual testing.

On Windows 10:
QMediaPlayer simply doesn't work with either FFmpeg or native backend
chosen.
Audio files are not loaded, nothing is played back, the app just freezes
without any error messages.

On Windows 11:
QMediaPlayer works with FFmpeg, but doesn't work with native backend.

On macOS 12 (Monterey) with Intel and macOS 14 (Sonoma) with Apple Silicon:
FFmpeg works much more stable than it used to in the version 6.6.2 which
could just freeze the application on loading a next file, especially when
trying to switch between different audio files too fast. This didn't occur
with the native backend, and this doesn't occur since the v6.6.3.
But now the switching between backends is performed in a weird way. When
trying to switch to the native 'darwin' backend (AVFoundation), it still
works as FFmpeg (e.g., plays OGG files), then after switching back to
FFmpeg, it behaves in the opposite way.

On Linux (Ubuntu 22.04.4) I haven't found any serious issues. The only
thing that with 6.7.0 it still behaves as if it uses FFmpeg (and not
GStreamer) in both cases. No matter what is the value of the
QT_MEDIA_BACKEND variable, it still throws the warning messages from FFmpeg
which do not result in any real performance issues.

When reinstalling PyQt6 with 'PyQt6<6.7.0' and 'PyQt6-Qt6==6.6.2'
directives, everything works as expected without changing anything in my
code on all the platforms. So, I had to update the 'requirements.txt' file
correspondingly.

Best,
Gdaliy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240505/3e5caed7/attachment.htm>


More information about the PyQt mailing list