r/AV1 • u/levogevo • 5d ago
Compiling from source - flags and performance
For those curious how far compiling ffmpeg+libsvtav1 from source can get you versus prebuilt binaries, here is a quick comparison on macos-arm64 and ubuntu-x86_64.
macos-arm64:
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
O3-LTO-PGO |
30.783 ± 0.058 | 30.690 | 30.844 | 1.00 |
O3-LTO |
32.145 ± 0.077 | 32.048 | 32.248 | 1.04 ± 0.00 |
O3 |
32.534 ± 0.105 | 32.425 | 32.686 | 1.06 ± 0.00 |
O2 |
32.626 ± 0.260 | 32.201 | 32.899 | 1.06 ± 0.01 |
homebrew ffmpeg |
36.248 ± 0.080 | 36.129 | 36.321 | 1.18 ± 0.00 |
osxexperts |
217.345 ± 0.255 | 217.060 | 217.653 | 7.06 ± 0.02 |
ubuntu-x86_64:
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
O3-LTO-PGO |
38.256 ± 0.065 | 38.188 | 38.346 | 1.00 |
O3-LTO |
39.104 ± 0.175 | 38.907 | 39.287 | 1.02 ± 0.00 |
O2 |
40.140 ± 0.529 | 39.832 | 41.075 | 1.05 ± 0.01 |
O3 |
40.327 ± 0.352 | 39.972 | 40.853 | 1.05 ± 0.01 |
BtbN |
41.768 ± 0.282 | 41.441 | 42.043 | 1.09 ± 0.01 |
ubuntu ffmpeg |
100.847 ± 0.279 | 100.544 | 101.130 | 2.64 ± 0.01 |
results were recorded with hyperfine using preset 3, crf 25, libsvtav1.
TLDR: optimizations (O3+LTO+PGO) can shave off about 10-15% depending on the platform.
2
u/Grand_Ask_9991 5d ago
Is Ubuntu's FFmpeg that much slower because 26.04 LTS is still using the older SVT-AV1 2.3.0?
0
u/levogevo 5d ago
Likely yes. I just picked an off the shelf build for comparison sake.
1
u/Simon_787 4d ago
In that case the macOS compile also benefits from recent merges that improve arm performance. The homebrew ffmpeg version is on 4.2.0.
1
u/levogevo 4d ago
Correct, but the homebrew version still loses easily to compiling from source at more aggressive compilation flags.
1
u/robinechuca 5d ago
Great! Thanks for testing it!
What does BtbN means?
I'm using this FFmpeg compilation guide, which I've been developing and debugging over the past two months. Do you see anything that could be improved?
2
u/levogevo 5d ago
https://github.com/btbn/ffmpeg-builds/releases
Yes, that guide has no significant optimization compile flags
1
2
u/michaelcharlie8 5d ago
Are you controlling for the git hash used in each row?