Accelerated Video Playback on the Raspberry Pi in Qt 6 on eglfs KMS
The old days of OpenMAX and omxplayer are now almost gone. Raspberry Pi has long moved to DRM/KMS and V4L2. Using omxplayer from Qt had the great benefit of reducing GPU workload by using the HVS, resulting in a more performant UI. I quickly developed an element to control omxplayer from Qt/QML in the past: https://github.com/carlonluca/pot/tree/master/piomxtextures_videolayer. Unfortunately, this technique is going to die soon, it seems, so I experimented with other options.
An alternative to the old approach is to draw the video on a DRM plane below, and place the Qt UI on a higher layer. According to the vc4 kernel driver, the HVS should still be used. Here is a demo of the result, compared to the old approach.
There seems to be a performance regression actually, more work is probably needed. Refer to this other article for a comparison with the old approach and the Qt5 demo.
Bye! 😉
Hi Luca,
can you go in deep into “alternative is to draw the video on a DRM plane below, and place the Qt UI on a higher layer”.
Starting a standard omxplayer instance with layer “-128” is enough? In my case if I set the layer to -128 I can’t see the player neither over the console.
Thank you.
Hello, omxplayer cannot be used when running of full kms. DRM plane can be used to something similar when running in kms.
Thank you for your fast reply. I’m still working with fkms. Until now I always draw omxplayer above Qt UI, but I wish to try to put it below.
Yes, on fkms omxplayer is still ok.
Ok, I understood now, maybe because th late night.