Log in

View Full Version : Lossy WEBP Colors


jay123210599
11th January 2025, 14:34
I want to make a lossy (yeah, you heard that right) animated WEBP file, but I also want it to have the same colors as my input video. How do I do that with ffmpeg or some other tool? How do I achieve very high quality for lossy webp files (both still and animated)?

huhn
11th January 2025, 15:36
lossless.
lossy compression at very high quality like crf 1 is often bigger then lossless crf 0.

you don't ask for the best on this forum because there is no answer.

jay123210599
11th January 2025, 16:17
lossless.
lossy compression at very high quality like crf 1 is often bigger then lossless crf 0.

you don't ask for the best on this forum because there is no answer.

What should the command be for very high quality lossy animated webp for ffmpeg? Are there any tools that could do the trick?

GeoffreyA
11th January 2025, 17:15
-quality 100

jay123210599
11th January 2025, 17:26
-quality 100

What about this? -lossless 0

GeoffreyA
11th January 2025, 18:31
Something along the lines of:

ffmpeg -i INPUT -lossless 0 -quality 100 OUTPUT.webp

The lossless switch is not strictly necessary because, by default, it is zero.

jay123210599
11th January 2025, 23:07
Something along the lines of:

ffmpeg -i INPUT -lossless 0 -quality 100 OUTPUT.webp

The lossless switch is not strictly necessary because, by default, it is zero.

I mean -lossless 0 by itself, without the -quality 100.

poisondeathray
11th January 2025, 23:37
I mean -lossless 0 by itself, without the -quality 100.

Look at the instructions / help

The default quality is 75 , without the -quality 100


ffmpeg -h encoder=libwebp



libwebp encoder AVOptions:
-lossless <int> E..V....... Use lossless mode (from 0 to 1) (default 0)
-preset <int> E..V....... Configuration preset (from -1 to 5) (default none)
none -1 E..V....... do not use a preset
default 0 E..V....... default preset
picture 1 E..V....... digital picture, like portrait, inner shot
photo 2 E..V....... outdoor photograph, with natural lighting
drawing 3 E..V....... hand or line drawing, with high-contrast details
icon 4 E..V....... small-sized colorful images
text 5 E..V....... text-like
-cr_threshold <int> E..V....... Conditional replenishment threshold (from 0 to INT_MAX) (default 0)
-cr_size <int> E..V....... Conditional replenishment block size (from 0 to 256) (default 16)
-quality <float> E..V....... Quality (from 0 to 100) (default 75)

jay123210599
12th January 2025, 00:27
What if my inputs are yuv222p or yuv444p videos? Will I still get the same colors if I use lossy webp?