Page 1 of 1

Video decoder output port info

Posted: Wed Nov 07, 2018 1:23 pm
by longo92
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

Re: Video decoder output port info

Posted: Fri Nov 09, 2018 2:05 pm
by longo92
Ok, i resolved: it's possibile to decode as opaque buffer and use the buffer as an EGL IMAGE. Fantastic.

Re: Video decoder output port info

Posted: Fri Nov 09, 2018 2:09 pm
by longo92
But the question is: why the opaque encoding is not listed as a supported encoding in the output port?

Re: Video decoder output port info

Posted: Fri Nov 09, 2018 5:11 pm
by 6by9
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.