2025-04-23 11:52 AM
Hi STM Team,
We are working with a custom board based on the STM32MP157DAC.We are facing a video lag issue when trying to play a video file from Qt application 6.5.3 using media player.
Even reducing the frame rate had no effect.
But if we use gst-play we are able to play the video without any lag or delay.
Do we need to enable any HW accelerator to play the video over GPU from Qt application? how we achive the same video output without lag when played using gst-play from Qt application.
Thanks.
2025-06-22 12:08 AM
Hello,
I was able to achieve smooth video playback in a Qt application by using a GStreamer pipeline with qml6glsink. By default, qml6glsink is not enabled in gst-plugins-good. After enabling it, I was able to use it successfully. Below is a link to the example code I referenced:
However, I have observed high CPU usage during video playback with qml6glsink from the Qt application. The CPU usage remains around 130–140%.
Is there a way to reduce CPU usage, possibly by offloading more processing to the GPU?
Thank you.
2025-06-25 4:53 AM
Hi,
I was doing the same exercise on STM32MP25, but it has an HW video accelerator MP157 does not have.
I am going to reproduce the same on MP15, but I don't see today possible optimization to offload tasks on GPU.
Just for check, but you might already think about it, use EGLFS configuration if you can.
BR,
Philippe.
2025-06-25 4:58 AM - edited 2025-06-25 5:02 AM
Hi @PPAGE.13
Thank you for your input.
I'll look into the EGLFS configuration and see how it behaves. If you have any reference or documentation on configuring EGLFS, I’d appreciate it if you could point me in that direction.
I’ll also be looking forward to you reproducing this setup on the STM32MP15.
Thanks again!
2025-06-25 5:12 AM
Hi,
for EGLFS configuration, you only need to stop weston service and set the following variable:
export QT_QPA_PLATFORM=eglfs
BR,
Philippe.
2025-06-26 1:35 AM
Hi @adnan_pasha,
by the way which gstreamer release do you use? On my side, I am on 1.22.12.
Because with "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-plugins-good/tests/examples/qt6/qmlsink?ref_type=heads" exampe, I cannot get the video inside Qt window.
BR,
Philippe.
2025-06-26 1:39 AM
Hi @PPAGE.13
I have 1.22.6-r0 streamer release.
What do you mean by "I cannot get the video inside Qt window"?
I didn't try the example. i used it as a refernce for my gstreamer pipeline for playing mp4 file.
2025-06-26 2:18 AM
Hi @adnan_pasha,
my goal is to have a Qt window with UI buttons (start/stop) and the video played by gstreamer inside the same window.
On your side, what do you run in your Qt application?
Philippe.
2025-06-26 2:20 AM
2025-06-26 2:58 AM
Hi @PPAGE.13 ,
I have a setup with two screens — one displays serial port data, and the other plays an MP4 video.
I noticed something interesting: the video item (using qml6glsink) wasn't detected unless it was included directly in the .qml file loaded from main.cpp. If I tried moving the video item to a second page or a separate QML file, it wouldn't load correctly. I suspect this is because the element wasn't part of the initial QML context loaded by main.cpp.
You might want to try this behavior on your end and see if it reproduces.
I've attached my example code for reference. Feel free to try it out — it worked for me. I also added a button to control the pipeline's play/pause state.
Do let me know if you have any new observations.
Thanks!