Log in

View Full Version : How to pipe a YUVA format ?


poisondeathray
12th December 2020, 21:48
How to pipe a YUVA format ? (with alpha channel) Such as yuva444p or yuva420p ? or ayuv etc...

ffmpeg's yuv4mpegpipe does not support alpha

vspipe does not support alpha with --y4m headers


rawvideo pipes can work, but without headers, so this means the other application requires raw input support

Background: I'm trying to get a YUVA pipe (from avisynth or vapoursynth) into libavif (avifenc.exe) . Supposedly it " can already encode and decode all AOM supported YUV formats and bit depths (with alpha)."; and it supports stdin, but I can't get pipes in with alpha . It can read a RGBA png sequence and work from that (but then you have less control over how the RGB=> YUV conversion is performed)

qyot27
12th December 2020, 21:54
The only other real alternative to yuv4mpegpipe is NUT (which is actually superior to y4m on several fronts*), but good luck finding something other than libavformat-based stuff that accepts it.

*NUT can do (Planar) RGB and audio. Seems to work with alpha formats too. (https://github.com/AviSynth/AviSynthPlus/issues/193)

poisondeathray
12th December 2020, 21:56
The only other real alternative to yuv4mpegpipe is NUT (which is actually superior to y4m on several fronts*), but good luck finding something other than libavformat-based stuff that accepts it.

*NUT can do (Planar) RGB and audio. Seems to work with alpha formats too. (https://github.com/AviSynth/AviSynthPlus/issues/193)

Sorry, I forgot to mention already tried NUT too; it didn't work with avifenc

manolito
12th December 2020, 22:37
I can't believe it, poisondeathray and qyot27 posting in the Newbies subforum... :devil:

Two of THE EXPERTS in the Newbies forum???

Please have this moved to a more suitable subforum...

richardpl
12th December 2020, 22:41
y4m supports yuv444alpha, but not many implement this.

poisondeathray
13th December 2020, 01:26
y4m supports yuv444alpha, but not many implement this.

Do you know of any y4m tools supporting read/write alpha that I can experiment with ? Google is not finding any

Can you please add it to ffmpeg when you have time ? :D

richardpl
13th December 2020, 09:44
444alpha support in y4m layer (avifenc, avifdec)

As you can see, avif supports it already, I added demux support for yuva444 in y4m couple months ago. The only missing part is adding also muxing support.

poisondeathray
13th December 2020, 17:25
Thanks, I'll keep an eye out for it when you add it :)

But how are the avif dev's testing this if the muxing support is not added ? What tools are they using ?

richardpl
13th December 2020, 21:56
They use own implementation of y4m, not libavformat.

poisondeathray
13th December 2020, 23:01
avs2pipemod-1.1.1 seems like it's close to working, the y4mp format is detected correctly YUV444 with alpha by avifenc, but avifenc says "Y4M frame header too large: (stdin)"


"avs2pipemod64" -y4mp "YUVA444P.avs" | "avifenc" --speed 8 --stdin "out_speed8_avs2pipemod.avif"



avs2pipemod[info]: writing 30 frames of 10/1 fps, 256x256,
sar 0:0, YUVA-444-planar-8bit progressive video.
Successfully loaded: (stdin)
AVIF to be written: (Lossy)
* Resolution : 256x256
* Bit Depth : 8
* Format : YUV444
* Alpha : Present
* Range : Limited
* Color Primaries: 1
* Transfer Char. : 13
* Matrix Coeffs. : 6
* ICC Profile : Absent (0 bytes)
* XMP Metadata : Absent (0 bytes)
* EXIF Metadata : Absent (0 bytes)
* Transformations: None
Encoding with AV1 codec 'aom' speed [8], color QP [0 (Lossless) <-> 10 (High)],
alpha QP [0 (Lossless) <-> 0 (Lossless)], tileRowsLog2 [0], tileColsLog2 [0], 1
worker thread(s), please wait...
* Encoding frame 1 [1/1 ts]: (stdin)
* Encoding frame 1 [1/1 ts]: (stdin)
Y4M frame header too large: (stdin)
avs2pipemod[info]: finished, wrote 0 frames [0%].
avs2pipemod[info]: total elapsed time is 0.234 sec.
avs2pipemod[error]: only wrote 0 of 30 frames.


Any help debugging this or magic switches for avs2pipemod? qyot27 ? I tried the default video setting instead of y4mp in avs2pipemod64, same error