MediaSDK icon indicating copy to clipboard operation
MediaSDK copied to clipboard

Intel msdk with QT GUI

Open APrashant opened this issue 3 years ago • 8 comments

Hi,

How can we use Intel Media SDK with Qt GUI application to decode and display multiple video streams on HDMI display? We have Intel apollo lake with Intel Media SDK for the purpose of hardware accelerated decoding functionality. We are trying to build GUI application that decodes and display the video stream using Intel Media SDK.

Please suggest any reference and also about the possibility if known.

Thanks in advance

APrashant avatar Dec 02 '21 10:12 APrashant

Hi @APrashant ,

Which OS?

dmitryermilov avatar Dec 02 '21 10:12 dmitryermilov

yocto-2.7 or Linux with 5.0 kernel

Actually we are able to use the samples but video is not displayed in qt window, rendering is happening on another window(x11), we need the video overlay on QT widgets. is there a way to pass Qt Widget window Id(QWidget::winId()) to media sdk, so that media sdk uses that handle instead of creating x11 / wayland window

APrashant avatar Dec 02 '21 10:12 APrashant

Thanks, @APrashant .

@VUNNYSODHI , @UngTengEn , @SiewHoon , can you please help? Do you know a way how to pass vaSurfaceId or Wayland handle or perhaps framebuffer handle to QT?

dmitryermilov avatar Dec 02 '21 11:12 dmitryermilov

Hi @VUNNYSODHI @UngTengEn @SiewHoon Is it possible to integrate intel media sdk with Qt GUI?

APrashant avatar Dec 08 '21 04:12 APrashant

@APrashant , @dmitryermilov I didn't use Qt GUI.

Here is the sample QT GUI with Gstreamer player. Maybe you can try and look on it how is work and implement on your code. https://github.com/FYPYTHON/qt-gstreamer-player

I didn't run this before. But you can refer to it and execute on it.

SiewHoon avatar Dec 08 '21 08:12 SiewHoon

Thanks @SiewHoon , yes we are able to integrate Qt GUI app with gstreamer & display multiple streams in Qt Grid. but we want achieve this with Hardware Acceleration, (I'm not sure but)some of the plugins we use in our gstreamer pipeline are CPU driven and consuming CPU clock. so when the Stream count increases like 16/25/36 streams then the CPU load is high. Instead of Gstreamer we are trying to use Intel Media SDK for decode and display to achieve HW acceleration. Is it possible to use Intel mediasdk with QT GUI?

APrashant avatar Dec 08 '21 09:12 APrashant

I searched across the Internet and couldn't find any mentioning of QT could make a "zero copy" rendering of vaSurfaceId's. In Intel (and I guess not only Intel) media stack on Linux, behind vaSurfaceId's there're underlying KMD-level drm handles (which often used as unified interface for interoperability across different media/compute/etc frameworks on Linux). But also no mentions of drm and QT interop. Please try to raise this problem at some QT forum.

dmitryermilov avatar Dec 09 '21 22:12 dmitryermilov

In QT got mention support OpenGL, maybe the rendering and go thru 3D mesa driver.

Not able to confirm QT OpenGL at here got support dmabuf sharing ("zero copy) or not.

Here is link maybe you can go explore and check with QT forum as mention by Dmitry: https://doc.qt.io/qt-5/qtgui-index.html https://doc.qt.io/qt-5/qopenglframebufferobject.html

But I know 3D mesa driver side, did support dmabuf sharing thru EGL (example glimagesink from gstreamer plugins with export GST_GL_PLATFORM=egl to enable to use dmabuf sharing).

Another option if you are running in wayland weston, they maybe you can consider look for qt-wayland-compositor.
https://doc.qt.io/qt-5/license-changes.html#qt-wayland-compositor Search for sample of QT running with wayland compositor side. That maybe can ask around QT forum see any can point to sample code.

SiewHoon avatar Dec 10 '21 06:12 SiewHoon