Encoding a single frame AVIF results in Error: The library only supports one picture in AVIF mode
This error occurs only with avif=1 flag specified and is present on both Ubuntu 20.04 (i9-10980XE) and Mac M1. Tried both avifenc and ffmpeg with the exact same result.
Using avifenc 1.3.0 (aom [enc/dec]:3.12.1-170-g146ad35ccc, rav1e [enc]:0.8.0 (p20250527-2-gc95438d), svt [enc]:v3.0.2-59-g0cfe990b)
Take any JPEG and try to encode it into AVIF using SVT:
avifenc --codec svt --yuv 420 input.jpeg output.avif
This results in (redacted for brevity):
Svt[info]: Only a single picture was passed in. Consider setting avif=1 for improved efficiency and reduced memory usage.
Encoded successfully.
* Color total size: 1407509 bytes
* Alpha total size: 0 bytes
Wrote AVIF: output.avif
Now, let's pass avif=1 to the encoder:
avifenc --codec svt --yuv 420 -a avif=1 input.jpeg output.avif
Svt[error]: Error: A picture has already been sent. The library only supports one picture in AVIF mode.
ERROR: Failed to finish encoding: Encoding of color planes failed
For completeness, here is the FFmpeg command used. The difference over avifenc is that FFmpeg miraculously saves the encoded file even though encoder throws an error.
ffmpeg -i input.jpeg -c:v libsvtav1 -qp 32 -svtav1-params avif=1 -preset 6 -pix_fmt yuv420p output.avif
Encoder throws in this particular line.
/cc @hguermaz