qgroundcontrol
qgroundcontrol copied to clipboard
Video streaming seems not work in windows qt6 qgc
Expected Behavior
Want to RTSP Video source play and work at qt6 QGC test source is rtsp://210.99.70.120:1935/live/cctv004.stream
Current Behavior
Recently saw that gstreamer fixes for qt6 qgc were merged. But it doesn't seem to play in Windows apps. I haven't tried any other OS.
Steps to Reproduce:
Please provide an unambiguous set of steps to reproduce the current behavior
- Download generated latest app by CI action
- In video settings, set source to rtsp
- input address
System Information
When posting bug reports, include the following information
- Operating System: Windows 11 Home 22H2
- Graphic Card: rtx3060ti
- QGC Version: master branch
- QGC build: daily
- gstreamer version : 1.18.1
- Qt 6.6.1 msvc 2019 64bit
Detailed Description
When I compiled it myself up to qt 5.15, it worked normally.
Log Files and Screenshots
- Screenshots of QGC console.
@zdanek Do you have the ability to test under Windows?
Yes I do.
Thank so much for looking at this.
[!] at D:\a\qgroundcontrol\qgroundcontrol\src\VideoReceiver\GstVideoReceiver.cc:1370 - "GStreamer error: Could not initialize window system"
I vaguely seem to remember fixes in the qmlsink thingy for Windows. Maybe we lost those somewhere along the way?
I obtained some important information through https://www.qt.io/blog/graphics-in-qt-6.0-qrhi-qt-quick-qt-quick-3d. Qt Quick aims to accelerate rendering using hardware. By default, it will be built on the low-level graphical API that is most suitable for the target platform. For example, on Windows, it will default to Direct3D, while on macOS, it will default to Metal.
So here, this line of code cannot run properly. https://github.com/mavlink/gst-plugins-good/blob/5ff0a6af0e1fd29bafc9f6644e728d24349d0ce7/ext/qt6/qt6glitem.cc#L527
In this way, we can simply bypass it by adding QQuickWindow:: setGraphicsApi (QSGRenderInterface:: GraphicsApi:: OpenGL);
to the main function. I successfully verified it on my MacBook m2. I think Windows can do the same. On Windows, it may also be possible to implement it through QCoreApplication: setAttribute (Qt:: AA_UseOpenGLES);
or QCoreApplication: setAttribute (Qt:: AA_UseSoftwareOpenGL);
.
However, I am not sure if doing so is correct. Does it have an impact on performance?
@NiiAAip great finding! Thank you. I will check it with Windows. I don't have an access to Mac. Can you create a PR with a fix?
I switched Mac builds to OpenGL. I also tested and it works there at least.
+1 for this. I have the same issue: video still doesn't work as of a commit d785993 (master).
At the same time, builds of Stable branches have video working ok (at least UDP RTP h264/h265, RSTP; MPEG-TS video isn't shown, but can be recorded with button).
To make video work in master build I've tried changing decoder from decodebin3
to decodebin
in GstVideoReceiver.cc
and QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
in main.cc
.
Still no luck :'(
Windows 11 23H2, Qt 6.6.1/5.15.2 MSVC2019 64bit
Latest daily is just spamming gst_element_factory_make when rtsp is enabled.
Hello everyone, has anyone resolved this issue yet?
Hello everyone, has anyone resolved this issue yet?
See #11421
Hello everyone, has anyone resolved this issue yet?
See #11421
Thank you very much! Luckily, it worked