pro90
Posts: 1
Joined: Fri Apr 13, 2018 11:37 am

Video playback on RPi3 with OpenGL Desktop driver (full KMS)

Fri Apr 13, 2018 12:28 pm

Hi,

I'm currently writing a gaming app for the RPi with Python and the KIVY Framework. For this application, it would be nice to have smooth video playback and OpenGL shader effects. Unfortunately, shader effects (shader transitions) in Kivy are only possible with the OGL Desktop driver (with standard "Legacy" drivers, there appears to be a memory leak somwhere).

The problem is that video playback is painfully slow with the Desktop drivers. The Kivy framework depends on gstplayer for video playback, but with other video players on the RPi the problem persists as well. My guess would be that the libraries and applications used for video playback have to be recompiled with the correct OGL library for hardware acceleration with the OGL Desktop driver activated. Has someone tried this yet and can point me in the right direction?

Thanks in advance!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5671
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Video playback on RPi3 with OpenGL Desktop driver (full KMS)

Sat Apr 14, 2018 7:02 am

I don't know about kivy specifically, but we're currently working on yuv support through the gl driver and kms. Predominantly this means support for dmabufs in order to avoid multiple image copies around the place.

You will need to rebuild Mesa to get the latest goodness, but https://github.com/anholt/drm_mmal/tree/x11?files=1 should work as a simple demo of getting video decode into a window via gl. Use ninja to build it, not the makefile (look at the git history for the full runes required).
Now mmal is Pi specific. I'm 95% of the way to having a v4l2 codec driver sorted, so it'd be worth checking of kivy can handle that directly.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ItayGal
Posts: 4
Joined: Mon Nov 07, 2016 8:48 am

Re: Video playback on RPi3 with OpenGL Desktop driver (full KMS)

Thu Jun 07, 2018 5:09 pm

Any news on that?
Will that work with OpenCV as well?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5671
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Video playback on RPi3 with OpenGL Desktop driver (full KMS)

Thu Jun 07, 2018 7:17 pm

https://github.com/6by9/linux/tree/rpi- ... and-codecs is probably my latest code branch. It's working with GStreamer, and FFmpeg with a small patch. Work is in progress to get it working with Chromium.
OpenCV I have no idea about.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 2 guests