JeDy111 wrote: ↑
Wed Sep 11, 2019 1:23 pm
The per-pixel alpha source could be a webm VP8 encoded video file like those used in https://simpl.info/videoalpha/
. By the way, for some reason, this URL freezes Chromium and FirefoxESR on my PI4.
Hmm, so a thing that Google crowbarred into the existing VP8 spec and hoped didn't break existing players.
I'd summarise those as weird formats, or what I'd consider image formats (PNG, Targa, and TIFF).
None of the video formats have any form of hardware accelerated decode on the Pi (or probably any SBC).
JeDy111 wrote:I understand the single mask value within RGB format would be like chroma-key. For instance replace green color with transparency. It could be a solution, but not as good as a 8 bits value for the opacity level, which allows for smooth edges and transitions.
Do you know a software, library, or piece of code which can do that?
Your only real hope is to get something like FFMpeg to decode the YUVA and format convert to RGBA.
Downloading their example VP8a file from https://cs.chromium.org/chromium/src/me ... -vp8a.webm
appears not to render with alpha using ffplay on an x86 box, but that may be because the default (only?) decode format is yuv420p (no alpha).
claims that ffmpeg can do YUV4:2:0 with alpha
Code: Select all
ffmpeg -i bear-vp8a.webm -pix_fmt yuva420p bear.yuv
seems to dump out something in between the YUV frames, but I haven't analysed it. Likewise requesting -pix_fmt rgba gives something that my normal raw image viewer (Vooya) seems to accept as RGBA. The RGBA should be easy enough to pass to DRM, MMAL video_render, or DispmanX.
By the way, I have found this OpenMAX blending of video and alpha mask
discussion which ends up with:
Saw in VideoCore IV docs that there is a Texture Datatype of RGBA32R, "Raster format 8-bit per channel red, green, blue, alpha", which is exactly what I need in order to avoid tiling/swizzling huge overhead. But as far as I can see, this is not exposed by the firmware. Why? Could this be added?
I don't know if that is something to investigate.
Those are only potentially applicable if you are rendering through GL/GLES, not using the HVS to add an overlay.
I've just checked the datasheet for the HVS - there are no YUVA formats supported.
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.