Camera example Freeze with QT6 on Ubuntu 22.04.1 when minimized or ApplicationDeactivate event.
-
@MStackoverflo Can you try Xorg(not wayland) first to see if the code works.
If your code does not work, post it here if possible. I can try it with both 5.15.3 and 6.6 for you.@JoeCFD Hi, I tried with Xorg on Ubuntu by setting
WaylandEnable=false
in/etc/gdm3/custom.conf
, but the QVideoWidget only shows one frame and freezes.The camera example is here :
https://doc.qt.io/qt-6/qtmultimedia-camera-example.html
https://doc.qt.io/qt-5.15/qtmultimedia-multimediawidgets-camera-example.htmlEDIT :
I'm developing an APP that uses that example's code, which is why I'm seeking help. -
@JoeCFD Hi, I tried with Xorg on Ubuntu by setting
WaylandEnable=false
in/etc/gdm3/custom.conf
, but the QVideoWidget only shows one frame and freezes.The camera example is here :
https://doc.qt.io/qt-6/qtmultimedia-camera-example.html
https://doc.qt.io/qt-5.15/qtmultimedia-multimediawidgets-camera-example.htmlEDIT :
I'm developing an APP that uses that example's code, which is why I'm seeking help.@MStackoverflo Just tested. Both work fine with a camera.
-
@MStackoverflo Just tested. Both work fine with a camera.
@JoeCFD Nice. That means it may be a setup problem. Did you try on a Virtual Machine or original? Also, were you on ubuntu 22?
-
@JoeCFD Nice. That means it may be a setup problem. Did you try on a Virtual Machine or original? Also, were you on ubuntu 22?
@MStackoverflo Not in a virtual machine. I tried it on Lubuntu 22.04.
-
@MStackoverflo Not in a virtual machine. I tried it on Lubuntu 22.04.
@JoeCFD I confirm that I cannot make it work on Ubuntu 22 when installed on a hard-drive. I get the same results. I'm currently trying to build on Lubuntu. Were you using wayland on Ubuntu? Because the default install I get is LXQt and uses x11. What is your setup?
-
@MStackoverflo Not in a virtual machine. I tried it on Lubuntu 22.04.
@JoeCFD I try to run it on Lubuntu 22.04 LXQT with QT6.6 and it shows a blank black screen. I would like to know your setup. I have a fresh Lubuntu with
sudo apt install build-essential libxcb*
-
@JoeCFD I try to run it on Lubuntu 22.04 LXQT with QT6.6 and it shows a blank black screen. I would like to know your setup. I have a fresh Lubuntu with
sudo apt install build-essential libxcb*
@MStackoverflo So many packages. I am not sure what you mean by setup. I use X11.
-
@MStackoverflo So many packages. I am not sure what you mean by setup. I use X11.
@JoeCFD Ok, the problem seems to be related in some ways to QT with wayland. Thank you for your time, it is very appreciated.
The app I need to develop is for Ubuntu 22 users, so it uses wayland.
Anyone has a clue on this setup?
-
I used gstreamer backend instead of ffmpeg and I no longer get the following error :
qt.gui.imageio.jpeg: JPEG datastream contains no image qt.gui.imageio.jpeg: JPEG datastream contains no image Invalid texture upload for 0x55e799d1ef80 layer=0 mip=0
Concerning video freeze, the window does not need to be minimized to freeze. If I slide another app over it to completely occlude it, it freezes. But, if there's even a small part showing, it doesn't freeze.
-
I made it work using XCB instead of Wayland. For some reason, QT has a problem with Wayland. QT can run using XCB even though Ubuntu desktop uses wayland.
Before invoking QApplication in main, these line must be added :
qputenv("QT_QPA_PLATFORM","xcb"); qputenv("QT_MEDIA_BACKEND","gstreamer");
libxcb packages must be installed prior.
-
-
I made it work using XCB instead of Wayland. For some reason, QT has a problem with Wayland. QT can run using XCB even though Ubuntu desktop uses wayland.
Before invoking QApplication in main, these line must be added :
qputenv("QT_QPA_PLATFORM","xcb"); qputenv("QT_MEDIA_BACKEND","gstreamer");
libxcb packages must be installed prior.
@MStackoverflo you may check if you have installed all wayland-related gstreamer packages. for example: gstreamer-gl-wayland-1.0.
and test some pipelines from command line. For example:
gst-launch-1.0 -v videotestsrc ! waylandsink