Change -preset 0 to a higher value; this is the lowest setting and it should in most cases severely slowdown encoding. A value of -preset 6 should be way faster. According to the ffmpeg wiki you can choose between 0 and 13 (13 only for debugging). Higher value → faster encoding. A lower value should give, in most cases, a smaller file (sometimes not; I had cases where 4 was smaller than 0).
I only used 0 here since it was such a small clip of low-ish resolution and encoding with -preset 0 and -preset 4 were both nearly instantaneous. (size comparison here -preset 0 128K and preset 4 135K)
Nice, changing that to 6 sure made it convert just as quickly as I expect. The resulting image quality seems fine as well, while actually being a slightly smaller file than what I get with my avifenc method.
Any idea why it dumps out this extra info every time I run it? I specifically use -hide_banner -loglevel error to avoid this type of thing. Even putting >/dev/null at the end of the command doesn’t stop it.
I have no detailed knowledge of how to suppress specific information output of ffmpeg. I actually like that it vomits out so much information; I have my terminal scroll back set to essentially infinite and can so better analyze what went wrong or not quite right.
Okay, now I know more: svt-av1 apparently pipes all its info as stderr, and that’s why -loglevel error doesn’t suppress it and why >/dev/null also doesn’t suppress it since this only redirects stdout to the void. You could do 2> /dev/null and suppress all stderr, or you could append it to a temp file with 2>> /tmp/ffmpeg-error.txt.
But I found a better solution in a superuser answer:
You can use the SVT_LOG environment variable like so:
SVT_LOG=1 only gives actual errors, and you can make it permanent by adding export SVT_LOG=1 to your shell profile.
Another thing: -quality 80 doesn’t do anything, and ffmpeg even gives a warning, which you suppressed. Quality is being controlled by -crf 34, see the wiki.
For the sake of comparison, I got JPEG-XL animations working from FFMPEG. But adjusting the values in the distance and effort options in the command below, I cannot get a file that is comparable to what I can get out of AVIF. Sure, it’s much better than GIF and pretty close to WebP, but compared to AVIF the JPEG-XL file is always either larger in file size or lower quality.
Comments
Change
-preset 0to a higher value; this is the lowest setting and it should in most cases severely slowdown encoding. A value of-preset 6should be way faster. According to the ffmpeg wiki you can choose between 0 and 13 (13 only for debugging). Higher value → faster encoding. A lower value should give, in most cases, a smaller file (sometimes not; I had cases where 4 was smaller than 0).I only used 0 here since it was such a small clip of low-ish resolution and encoding with
-preset 0and-preset 4were both nearly instantaneous. (size comparison here-preset 0128K and preset 4 135K)Nice, changing that to
6sure made it convert just as quickly as I expect. The resulting image quality seems fine as well, while actually being a slightly smaller file than what I get with my avifenc method.Any idea why it dumps out this extra info every time I run it? I specifically use
-hide_banner -loglevel errorto avoid this type of thing. Even putting>/dev/nullat the end of the command doesn’t stop it.$ ffmpeg -y -hide_banner -loglevel error -i *.mp4 -an -c:v libsvtav1 -crf 34 -preset 6 -svtav1-params fast-decode=2 -g 300 -pix_fmt yuv420p -vf "fps=25, scale=-1:480" -quality 80 'test3'.avif >/dev/null Svt[info]: ------------------------------------------- Svt[info]: SVT [version]: SVT-AV1 Encoder Lib v3.1.2 Svt[info]: SVT [build] : GCC 16.0.1 20260115 (Red Hat 16.0.1-0) 64 bit Svt[info]: ------------------------------------------- Svt[info]: Level of Parallelism: 5 Svt[info]: Number of PPCS 76 Svt[info]: [asm level on system : up to avx512icl] Svt[info]: [asm level selected : up to avx512icl] Svt[info]: ------------------------------------------- Svt[info]: SVT [config]: main profile tier (auto) level (auto) Svt[info]: SVT [config]: width / height / fps numerator / fps denominator : 640 / 480 / 25 / 1 Svt[info]: SVT [config]: bit-depth / color format : 8 / YUV420 Svt[info]: SVT [config]: preset / tune / pred struct : 6 / PSNR / random access Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type : 300 / 16 / key frame Svt[info]: SVT [config]: BRC mode / rate factor : CRF / 34 Svt[info]: SVT [config]: AQ mode / Variance Boost : 2 / 0 Svt[info]: SVT [config]: sharpness / luminance-based QP bias : 0 / 0 Svt[info]: -------------------------------------------Glad that it worked for you!
I have no detailed knowledge of how to suppress specific information output of ffmpeg. I actually like that it vomits out so much information; I have my terminal scroll back set to essentially infinite and can so better analyze what went wrong or not quite right.
Okay, now I know more: svt-av1 apparently pipes all its info as stderr, and that’s why
-loglevel errordoesn’t suppress it and why>/dev/nullalso doesn’t suppress it since this only redirects stdout to the void. You could do2> /dev/nulland suppress all stderr, or you could append it to a temp file with2>> /tmp/ffmpeg-error.txt.But I found a better solution in a superuser answer:
You can use the
SVT_LOGenvironment variable like so:SVT_LOG=1 ffmpeg -y -hide_banner -loglevel error -i *.mp4 -an -c:v libsvtav1 -crf 34 -preset 6 -svtav1-params fast-decode=2 -g 300 -pix_fmt yuv420p -vf "fps=25, scale=-1:480" 'test4'.avifSVT_LOG=1only gives actual errors, and you can make it permanent by addingexport SVT_LOG=1to your shell profile.Another thing:
-quality 80doesn’t do anything, and ffmpeg even gives a warning, which you suppressed. Quality is being controlled by-crf 34, see the wiki.Thanks! I will work that into my workflow.
For the sake of comparison, I got JPEG-XL animations working from FFMPEG. But adjusting the values in the
distanceandeffortoptions in the command below, I cannot get a file that is comparable to what I can get out of AVIF. Sure, it’s much better than GIF and pretty close to WebP, but compared to AVIF the JPEG-XL file is always either larger in file size or lower quality.ffmpeg -i test.mp4 -c:v libjxl_anim -f image2pipe -distance 8 -effort 5 -loop 0 -vf "fps=25, scale=-1:480" test.jxlSign in to comment. Sign in