ktb92677
Posts: 28
Joined: Fri Sep 20, 2013 10:29 pm

Overlay OpenGLES and MMAL h264 decoder

Fri Aug 09, 2019 8:21 pm

Hi all! So I have the following complex situation I need help resolving. I want to overlay graphics in a hardware accelerated fashion on top of an h264 video stream displayed on a raspberry PI. I built an MMAL h264 decoder based on this code here: https://github.com/raspberrypi/userland ... _basic_2.c.

The OpenGLES code I used was copied from here: https://github.com/vurtun/nuklear/tree/ ... _opengles2. (yes, I want to render GUI components on top of the h264 stream)

Currently for some reason the OpenGLES graphics always completely hides the h264 stream running even if I set the background color to totally transparent like this:

Code: Select all

glClearColor(0, 0, 0, 0);
Any help would be greatly appreciated!

User avatar
dividuum
Posts: 188
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Overlay OpenGLES and MMAL h264 decoder

Fri Aug 09, 2019 8:40 pm

A good start is probably to take a look at the output of `vcgencmd dispmanx_list`. It'll show your the arrangement of layers.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

ktb92677
Posts: 28
Joined: Fri Sep 20, 2013 10:29 pm

Re: Overlay OpenGLES and MMAL h264 decoder

Fri Aug 09, 2019 8:43 pm

dividuum wrote:
Fri Aug 09, 2019 8:40 pm
A good start is probably to take a look at the output of `vcgencmd dispmanx_list`. It'll show your the arrangement of layers.
Oh cool utility! Is there anyway to set the layer of OpenGLES? Anyway to set the layer of MMAL? Anyway to set the background of OpenGLES to transparent to show the underlying MMAL stream based on the examples I linked?

User avatar
dividuum
Posts: 188
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Overlay OpenGLES and MMAL h264 decoder

Fri Aug 09, 2019 8:49 pm

I got that working using the old OMX API from my existing code. I'm currently porting this over to the MMAL API and run into basically the same issues myself. See my post at https://www.raspberrypi.org/forums/view ... 7&t=248353
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

ktb92677
Posts: 28
Joined: Fri Sep 20, 2013 10:29 pm

Re: Overlay OpenGLES and MMAL h264 decoder

Fri Aug 09, 2019 9:00 pm

Wow, we posted our topics at fairly similar times! There must be a solution to this... maybe @6by9 can shed some light here

Return to “OpenGLES”