Open mfreeborn opened 1 year ago
Hi, YUV420 is not supported right now. We currently only have conversion support for the packed/interleaved YUV formats, i.e. YUYV
and UYVY
.
YUV420 looks like a planar format - can you confirm this is the case for your image? There's a helpful format description in the VLC wiki: https://wiki.videolan.org/YUV#UYVY.
Thanks for the reply - that VLC article has clarified things significantly. Yes, my format is I420 - planar.
I understand the functionality of this crate now and can make some progress.
Would you be interested in adding this functionality to this crate? Planar image support is something I‘ve wanted to tackle for some time now, but never really got to it.
I can draft a first implementation for you to test if you don’t want to handle it. Should not take more than a week or two - there’s some smaller fish to fry first.
I just pushed preliminiary YUV 420p support to the next
branch: https://github.com/raymanfx/ffimage/commit/e133a7dcfd89df030a873b0168f643e13126e206. It's untested though.
next
is a major rework of the code that's in master
right now, but the benchmark code in the commit should give you an idea how to use it.
I have a raw buffer of bytes which is a YUV420 format frame from a camera, which I am trying to convert to RGB (well, ultimately to a JPEG).
My code, however, panics when I try to do the conversion, looking something like this:
And then I get a really long panic message:
Is YUV420 conversion supported?