Qt Multimedia Issues
-
wrote on 13 Jun 2024, 00:37 last edited by
Hello,
I am nearing completion of a Qt project and am running into several issues related to playing a video stream (webcam). I have tried a few versions of Qt to solve the issue and have different results and could use some guidance. This is using Qt C++
I have not been able to test the example media player because it's a qtquick application but also confirmed these results in isolated projects using code snippets from Qt Docs
Qt version 6.6.3 GCC 64 QVideoWidget & QMediaPlayer
Host: Linux 64bit (wayland)Most of the gui is frozen when I switch pages to the one with QVideoWidget. Animations stop running and signals/slots from the parent widget of QVideoWidget stop functioning. Other gui elements (like my menu buttons) still respond.
Qt version 6.6.3 GCC 64 QGraphicsVideoItem & QMediaPlayer
Host: Linux 64bit (wayland)Setting up the video in a QGraphicsView/Scene seems to mostly function. It plays the webcam stream without issue...until I resize it. I seem to have to leave it in it's native resolution - otherwise it's filled with green bars whose size depends on how much I've scaled the video. In the screenshots I changed the aspect ratio to show this.
Qt version 6.7.1 GCC 64 QGraphicsVideoItem & QMediaPlayer
Host: Linux ARM64 (wayland)Just got a new raspberry pi 5 and wanted to see if the banding issue was present on there too. The installer is only letting me choose Qt6.7+. Got everything setup (at least whats needed for my desktop environment) and this results in a black screen with qt complaining about no Multimedia Backends being available. I have ffmpeg and libva packages installed.
Some googling suggests this is an issue introduced recently with 6.7.0 but cannot confirm that and the preview of 6.8.0 is the same.
-
wrote on 13 Jun 2024, 04:25 last edited by
For the issues with video streaming in your Qt project:
QVideoWidget Freezing: Move video processing to a separate thread to prevent GUI freezing.
QGraphicsVideoItem Green Bars: Check resizing logic and maintain aspect ratio during resize.
No Multimedia Backends on Raspberry Pi: Ensure all required multimedia backend packages are installed and configured for Qt.
Consider visiting Qt forums for more detailed support if needed. -
For the issues with video streaming in your Qt project:
QVideoWidget Freezing: Move video processing to a separate thread to prevent GUI freezing.
QGraphicsVideoItem Green Bars: Check resizing logic and maintain aspect ratio during resize.
No Multimedia Backends on Raspberry Pi: Ensure all required multimedia backend packages are installed and configured for Qt.
Consider visiting Qt forums for more detailed support if needed.wrote on 13 Jun 2024, 06:47 last edited by@vincent9874 said in Qt Multimedia Issues:
For the issues with video streaming in your Qt project:
QVideoWidget Freezing: Move video processing to a separate thread to prevent GUI freezing.
QGraphicsVideoItem Green Bars: Check resizing logic and maintain aspect ratio during resize.
No Multimedia Backends on Raspberry Pi: Ensure all required multimedia backend packages are installed and configured for Qt.
Consider visiting Qt forums for more detailed support if needed.Thank you for your responding :)
QVideoWidget Freezing: there is no media playing at the time of it freezing - the media is loaded after the page load. Just having it on the actively visible widget causes it to lockup.
QGraphicsVideoItem Green Bars: I am maintaining the aspect ratio of the source. For the examples I changed my camera config from 16:9 to 4:3 to show how the bars propagate differently based on size. If I do it on my isolated project the bars change in size and frequency as I resize the window.
Raspberry pi: ffmpeg, libav and gstreamer are all installed and Qt 6.5+ should be configured for ffmpeg by default.
What forums do you suggest? A sub here or like qt centre?
-
@vincent9874 said in Qt Multimedia Issues:
For the issues with video streaming in your Qt project:
QVideoWidget Freezing: Move video processing to a separate thread to prevent GUI freezing.
QGraphicsVideoItem Green Bars: Check resizing logic and maintain aspect ratio during resize.
No Multimedia Backends on Raspberry Pi: Ensure all required multimedia backend packages are installed and configured for Qt.
Consider visiting Qt forums for more detailed support if needed.Thank you for your responding :)
QVideoWidget Freezing: there is no media playing at the time of it freezing - the media is loaded after the page load. Just having it on the actively visible widget causes it to lockup.
QGraphicsVideoItem Green Bars: I am maintaining the aspect ratio of the source. For the examples I changed my camera config from 16:9 to 4:3 to show how the bars propagate differently based on size. If I do it on my isolated project the bars change in size and frequency as I resize the window.
Raspberry pi: ffmpeg, libav and gstreamer are all installed and Qt 6.5+ should be configured for ffmpeg by default.
What forums do you suggest? A sub here or like qt centre?
wrote on 20 Jun 2024, 10:57 last edited by@DigitalArtifex I guess this is more a Qt issue than a FFmpeg or gstreamer problem. If you run a FFmpeg pipeline from command line and a default windows pops up, you may not have any freezing problem with the widget. It could be an issue if Qt widget is resized too quickly, for example.
-
@DigitalArtifex I guess this is more a Qt issue than a FFmpeg or gstreamer problem. If you run a FFmpeg pipeline from command line and a default windows pops up, you may not have any freezing problem with the widget. It could be an issue if Qt widget is resized too quickly, for example.
wrote on 1 Jul 2024, 17:57 last edited byThank you, it does seem to be a Qt issue with Gnome. I had issues with QVideoWidget, QWidget::createWindowContainer and QColorDialog::getColor corrupting the rendering of my application.
Out of desperation I switched everything to KDE and it works as expected.
The raspberrypi was my fault and fixed it by explicitly specifying the backend