Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video streaming seems not work in windows qt6 qgc #11020

Open
hyeonseung89 opened this issue Feb 6, 2024 · 9 comments · May be fixed by #11421
Open

Video streaming seems not work in windows qt6 qgc #11020

hyeonseung89 opened this issue Feb 6, 2024 · 9 comments · May be fixed by #11421

Comments

@hyeonseung89
Copy link

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

  1. Download generated latest app by CI action
  2. In video settings, set source to rtsp
  3. 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.
    image
@DonLakeFlyer
Copy link
Contributor

@zdanek Do you have the ability to test under Windows?

@zdanek
Copy link
Collaborator

zdanek commented Feb 6, 2024

Yes I do.

@DonLakeFlyer
Copy link
Contributor

Thank so much for looking at this.

@AlexKlimaj
Copy link
Contributor

AlexKlimaj commented Feb 9, 2024

[!] at D:\a\qgroundcontrol\qgroundcontrol\src\VideoReceiver\GstVideoReceiver.cc:1370 - "GStreamer error: Could not initialize window system"

log.txt

@DonLakeFlyer
Copy link
Contributor

I vaguely seem to remember fixes in the qmlsink thingy for Windows. Maybe we lost those somewhere along the way?

@NiiAAip
Copy link

NiiAAip commented Feb 24, 2024

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?

@zdanek
Copy link
Collaborator

zdanek commented Feb 24, 2024

@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?

@DonLakeFlyer
Copy link
Contributor

I switched Mac builds to OpenGL. I also tested and it works there at least.

@TishSerg
Copy link

+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

@TishSerg TishSerg linked a pull request Apr 30, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants