Custom shader for YUV data

I’ve been wanting to learn more about custom shaders and am also interested in using Iced for multimedia applications at some point, so wanted to share my latest Iced project: Vanilla Iced

It is a shader which handles conversion of YUV to RGBA so that you can work directly with decoded frames from various sources. In the examples there are some experiments with widgets, gstreamer, etc.

I’m probably doing some things wrong as the output is a bit blocky, also I haven’t compared the performance to just converting to RGBA on the CPU. It does seem to work though, so hopefully some here will find it helpful!

1 Like

That’s very cool!

I wonder if the YUV data could be buffered and uploaded to the GPU in batches to avoid constant upload latency (for video, specifically).

1 Like

That’d be great! Perhaps multiple frames could be stored in an atlas, closer to how the image pipeline works.