Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: extend crf-search over more presets at once #243

Open
mr44er opened this issue Dec 6, 2024 · 4 comments
Open

Feature request: extend crf-search over more presets at once #243

mr44er opened this issue Dec 6, 2024 · 4 comments

Comments

@mr44er
Copy link

mr44er commented Dec 6, 2024

The idea came about because I got my latest energy bill and electricity prices here are brutally expensive. This is the perfect expression of how politicians simply hate the people.

Anyway, I thought that you could do the same thing with multiple presets, just like with -min-vmaf/-max-vmaf, and then decide at the end how long you want to waste power on it and, in relation to that, the file size. For example, if the difference between preset 5 and preset 6 is around 10 MB, preset 6 would be sufficient.

I was thinking something like ab-av1 preset-search --min-preset 0 --max-preset 8 where just ab-av1 preset-search has defaults of --min-preset 6 and --max-preset 8

@stickz
Copy link

stickz commented Dec 12, 2024

There is no value added doing this. You can predict the difference before running ab-av1.

trade_off_example

@mr44er
Copy link
Author

mr44er commented Dec 12, 2024

I hear ya and I know that, but there is still a huge gap between quiet material having less movement and actionpacked, many fast scenes. Yes, depending on samples.
Also it doesn't help with file size prediction.

@alexheretic
Copy link
Owner

This is something I've done with simple scripting on top of ab-av1. It's quite useful for comparing presets with similar VMAF quality output, typically harder to do as you need to search for the crfs that achieve this (exactly what ab-av1 is made for).

However, I'm not sure I see the value yet in having a dedicated command for multi-preset. Were you were thinking of an automated multi-preset crf-search? That could be worth investigating, but we'd need a clear vision of how it would work / why it would be useful. Analysing multiple presets tends to be very slow.

E.g.

# fish shell
$ for preset in 10 8 6 4
     echo "# preset $preset"
     ab-av1 crf-search -i 4kmedia-spacex-launch-demo.mp4 --preset $preset --min-vmaf 98 --samples 1
  end

# preset 10
- crf 32 VMAF 96.10 (9%)
  00:01:25 crf 19 1/1 ######################################################################################### (eta 0s)
Encode with: ab-av1 encode -i 4kmedia-spacex-launch-demo.mp4 --crf 19 --preset 10

crf 19 VMAF 98.19 predicted video stream size 47.87 MiB (27%) taking 2 minutes
# preset 8
- crf 32 VMAF 96.47 (9%) (cache)
- crf 19 VMAF 98.57 (29%) (cache)
  00:00:54 crf 23 1/1 ######################################################################################### (eta 0s)
Encode with: ab-av1 encode -i 4kmedia-spacex-launch-demo.mp4 --crf 23 --preset 8

crf 23 VMAF 98.14 predicted video stream size 38.41 MiB (22%) taking 3 minutes
# preset 6
- crf 32 VMAF 96.56 (9%)
- crf 19 VMAF 98.61 (29%)
  00:02:58 crf 23 1/1 ######################################################################################### (eta 0s)
Encode with: ab-av1 encode -i 4kmedia-spacex-launch-demo.mp4 --crf 23 --preset 6

crf 23 VMAF 98.18 predicted video stream size 38.67 MiB (22%) taking 3 minutes
# preset 4
- crf 32 VMAF 96.91 (7%)
- crf 19 VMAF 98.82 (26%)
  00:06:41 crf 25 1/1 ######################################################################################### (eta 0s)
Encode with: ab-av1 encode -i 4kmedia-spacex-launch-demo.mp4 --crf 25 --preset 4

crf 25 VMAF 98.18 predicted video stream size 26.22 MiB (15%) taking 11 minutes

@mr44er
Copy link
Author

mr44er commented Jan 6, 2025

Were you were thinking of an automated multi-preset crf-search?

Yes.

why it would be useful

The main purpose should be a quick overview (and having it automated) to see how long it would need to draw power.
Just the easy example (and start with the fastest so you can STRG+C if you are already satisfied with filesize and time estimation):
preset12 -> 200MB ~1 minute
preset11 -> 190MB ~1:30 minutes
preset10-> 188MB ~ 4 minutes
preset9 -> 170MB ~ 6 minutes
preset8 -> 150MB ~11minutes
preset7 -> 130MB ~50 minutes
preset6 -> 100MB ~2hours
preset5 -> 80MB ~3hours
preset4 -> 60MB ~4:30hours
...
preset1 -> 22MB ~6hours
preset0 -> 20MB ~8 hours

One could decide on personal preference between preset8 and preset7...that ~20MB are not worth the 39 minutes more power draw or if the 2MB difference @preset1/0 is worth the smaller file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants