longo92
Posts: 45
Joined: Mon Sep 03, 2018 3:45 pm
Contact: Website Skype

Video decoder output port info

Wed Nov 07, 2018 1:23 pm

HI, i have a file .h264 that is decoded using MMAL_COMPONENT_DEFAULT_VIDEO_DECODER. I want transform each decoded frame in an OpenGl ES texture. I know (and i tested) that there is a way to tranform each camera frame in an EGL image (and then use it as a texture) through opaque buffer (MMAL_ENCODING_OPAQUE); this is very efficent beacause it uses eglCreateImageKHR with the opaque buffer and don't have to pass through the glTexImage2D (that requites the buffer in RGB encoding). Do you know if there is a similar approach for the video decoder? Do you know if i can set the output port of video encoding as MMAL_ENCODING_OPAQUE? Thanks

longo92
Posts: 45
Joined: Mon Sep 03, 2018 3:45 pm
Contact: Website Skype

Re: Video decoder output port info

Fri Nov 09, 2018 2:05 pm

Ok, i resolved: it's possibile to decode as opaque buffer and use the buffer as an EGL IMAGE. Fantastic.

longo92
Posts: 45
Joined: Mon Sep 03, 2018 3:45 pm
Contact: Website Skype

Re: Video decoder output port info

Fri Nov 09, 2018 2:09 pm

But the question is: why the opaque encoding is not listed as a supported encoding in the output port?
Attachments
Cattura.PNG
Cattura.PNG (8.09 KiB) Viewed 3220 times

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

Re: Video decoder output port info

Fri Nov 09, 2018 5:11 pm

longo92 wrote:
Fri Nov 09, 2018 2:09 pm
But the question is: why the opaque encoding is not listed as a supported encoding in the output port?
It's a quirk of the handling. All the pixel formats are probed via one parameter, opaque would have to be detected via another.
I might see if I can add it for completeness.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics programming”