View Full Version : Convert To YUVA420P8 ?
poisondeathray
6th February 2020, 00:27
From a RGBA source, what is the proper way to convert to YV12 with alpha (YUVA420P8)
YUVA420P8 is listed as supported , but how to convert to it ?
http://avisynth.nl/index.php/Convert
http://avisynth.nl/index.php/Avisynthplus_color_formats
I tried ConvertToYUVA420P8 , ConvertToYUVA, ConvertToYUVA420, and other combinations, but not working
Thanks
qyot27
6th February 2020, 01:06
It seems someone was a little overzealous adding that to the wiki. There are no ConvertToYUVA functions.
The way to do it from RGBA/RGB32 is:
Version()
ConvertToPlanarRGBA()
ConvertToYUV420()
Running ConvertToYUV420() on RGB32 drops the alpha channel. Granted, I don't know if this PlanarRGBA passthrough trick retains it either, but FFmpeg is reporting that the pix_fmt it receives from AviSynth+ in that case is yuva420p.
poisondeathray
6th February 2020, 01:17
Thanks qyot27 ; it works .
Info() looks correct as well for yuva420p
And ShowAlpha() shows the alpha is retained and valid too
And ffmpeg encoding that script to a yuva420p format (eg. webp) works too (valid alpha)
What are the pros/cons to having some of those steps rolled into some internal function ? Maybe it's not worth it , it's not going to be used that often.
But maybe the docs should be clarified a bit
pinterf
6th February 2020, 10:56
What are the pros/cons to having some of those steps rolled into some internal function ? Maybe it's not worth it , it's not going to be used that often.
But maybe the docs should be clarified a bit
Or you can use AddAlphaPlane
http://avisynth.nl/index.php/CombinePlanes#AddAlphaPlane
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.