cancel
Showing results for 
Search instead for 
Did you mean: 

Video lags on STM32MP157DAC custom boad when playing through Qt6 application

adnan_pasha
Senior

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.

15 REPLIES 15
adnan_pasha
Senior

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.

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
adnan_pasha
Senior

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!

Hi,

for EGLFS configuration, you only need to stop weston service and set the following variable:

export QT_QPA_PLATFORM=eglfs

 

BR,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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.

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
PPAGE.13
ST Employee

Note: attached append recipe to get Qt 6 gstreamer config support.

This could interest other people.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
adnan_pasha
Senior

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!