master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.46k stars 151 forks source link

avif encoding support is not perfect #785

Open sommio opened 11 months ago

sommio commented 11 months ago

aom can't encode jpeg (yuvj420p) and --pix-format doesn't work, although it can be replaced with -sc-pix-format for now, but av1an gives a new error when encoding webp and png.

Information

Reproduction

av1an -i test.jpg --pix-format yuv444p10le -o test.jpg.avif
av1an -i test.jpg --sc-pix-format yuv444p10le -o test.jpg.avif
av1an -i test.webp --sc-pix-format yuv444p10le -o test.webp.avif
av1an -i test.png --sc-pix-format yuv444p10le -o test.png.avif

Expected

Actual

❯ av1an -i test.jpg --pix-format yuv444p10le -o test.jpg.avif
INFO [av1an_core::settings] Input: 4032x3024 @ 25.000 fps, YUVJ420P, SDR
Scene detection
00:00:00 ▕                                      ▏   0%  0/1 (0 fps, eta unknown)
Error: aom does not support YUVJ420P
❯ av1an -i test.webp --sc-pix-format yuv444p10le -o test.webp.avif
INFO [av1an_core::settings] Input: 1920x1080 @ 25.000 fps, ARGB, SDR
Scene detection
INFO [av1an_core::settings] scenecut: found 1 scene(s) [with extra_splits (250 frames): 1 scene(s)]
  00:00:00 ▕█████████████████████████████████████████████████████████████████████████████████████████████▏ 100%  1/1 (5.09 fps, eta 0s)Queue 1 Workers 1 Passes 2
Params: --threads=8 --cpu-used=6 --end-usage=q --cq-level=30 --tile-columns=1 --tile-rows=0
WARN [av1an_core::broker] Encoder failed (on chunk 0):
encoder crashed: exit status: 1
stdout:

stderr:
        Fatal: Specify stream dimensions with --width (-w)  and --height (-h)

source pipe stderr:
        Warning: setVideoInfo: Video filter LWLibavSource has more than one output node but only the first one will be returned
        Error: can only apply y4m headers to YUV and Gray format clips without alpha
        Output 1 frames in 55264.79 seconds (0.00 fps)
        Warning: Core freed but 1 filter instance(s) still exist
        Warning: Core freed but 8294656 bytes still allocated in framebuffers

ffmpeg pipe stderr:
        fd:: Invalid data found when processing input

WARN [av1an_core::broker] Encoder failed (on chunk 0):
encoder crashed: exit status: 1
stdout:

stderr:
        Fatal: Specify stream dimensions with --width (-w)  and --height (-h)

source pipe stderr:
        Warning: setVideoInfo: Video filter LWLibavSource has more than one output node but only the first one will be returned
        Error: can only apply y4m headers to YUV and Gray format clips without alpha
        Output 1 frames in 55264.97 seconds (0.00 fps)
        Warning: Core freed but 1 filter instance(s) still exist
        Warning: Core freed but 8294656 bytes still allocated in framebuffers

ffmpeg pipe stderr:
        fd:: Invalid data found when processing input

ERROR [av1an_core::broker] [chunk 0] encoder failed 3 times, shutting down worker
ERROR [av1an_core::broker] [chunk 0] encoder crashed: exit status: 1
stdout:

stderr:
        Fatal: Specify stream dimensions with --width (-w)  and --height (-h)

source pipe stderr:
        Warning: setVideoInfo: Video filter LWLibavSource has more than one output node but only the first one will be returned
        Error: can only apply y4m headers to YUV and Gray format clips without alpha
        Output 1 frames in 55265.16 seconds (0.00 fps)
        Warning: Core freed but 1 filter instance(s) still exist
        Warning: Core freed but 8294656 bytes still allocated in framebuffers

ffmpeg pipe stderr:
        fd:: Invalid data found when processing input

Sample Samples.zip

BlueSwordM commented 9 months ago

Why not encode using avifenc?