Skip to main content
Visitor II
April 23, 2025
Question

Video lags on STM32MP157DAC custom boad when playing through Qt6 application

  • April 23, 2025
  • 5 replies
  • 1089 views

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.

    This topic has been closed for replies.

    5 replies

    Visitor II
    June 22, 2025

    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.

    ST Employee
    June 25, 2025

    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.

    Visitor II
    June 25, 2025

    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!

    ST Employee
    June 25, 2025

    Hi,

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

    export QT_QPA_PLATFORM=eglfs

     

    BR,

    Philippe.

    ST Employee
    June 26, 2025

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

    This could interest other people.

    Visitor II
    June 26, 2025

    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!

    ST Employee
    June 27, 2025

    Hello @adnan_pasha ,

    thank you very much for your example. It has also worked on my side on STM32MP257.

    I will investigate why gstreamer reference example does not work as it is.

    And I will also use a gstreamer command compatible with MP25 video hardware accelerator and check the CPU load in that configuration. We will see if we can get some clue for your initial question on MP157.

    BR,

    Philippe.

    Visitor II
    June 27, 2025

    Hi @PPAGE.13 

    Good to hear it’s working for you.

    I tried setting the EGLFS environment variables as you suggested, but I still observe high CPU usage when playing a video file.

    Also, I noticed that there’s no framebuffer device present on my system. We're using the MIPI-DSI subsystem for display, which relies on DRM drivers. Could the absence of a framebuffer be contributing to the issue?


    root@stm32mp15-disco:~# ls -l /dev/fb*
    ls: cannot access '/dev/fb*': No such file or directory

    Thanks.

    Visitor II
    June 27, 2025

    Hi,

    I realize this isn’t related to video playback, but I’ve also been working on optimizing boot time. Currently, it takes around 40 to 42 seconds for my application to start automatically via a systemd service.

    I’ve gone through ST’s documentation on boot time optimization, but haven’t seen any significant improvements. I also tried skipping U-Boot and booting directly into the kernel, but haven’t had success with that yet.

    If you have any advice or suggestions to help reduce the boot time further, I’d really appreciate it.

    Thanks!