ab-av1 icon indicating copy to clipboard operation
ab-av1 copied to clipboard

Support `--enc svtav1-params=` as an override

Open veikk0 opened this issue 1 year ago • 5 comments

I was testing tune=1 vs tune=0 with the latest ab-av1 git and ended up with identical output files (matching sha1sums). Looking at the actual FFmpeg command being run, it seems that since ab-av1 is adding its own -svtav1-params scd=0, any -svtav1-params the user specifies with --enc is overridden (with multiples of a parameter, only the latter is applied by FFmpeg).

Since SvtAv1EncApp usage was removed, I had basically forgotten about the --svt parameter, which seems to be the way to set -svtav1-params currently. I've been using --enc for all the encoders I use with ab-av1, but due to the above, the behavior isn't consistent between SVT-AV1 and other encoders.

scd hasn't done anything since SVT-AV1 0.9.1, so it has no effect in recent SVT-AV1 versions.

Command to reproduce:

ab-av1 auto-encode -e libsvtav1 --enc svtav1-params=tune=0:keyint=300 --min-vmaf 93.4 --pix-format yuv420p --preset 8 -o tune0.ivf --input input.mp4

veikk0 avatar Mar 17 '23 01:03 veikk0

Yes, you need to use it multiple times: ... --svt tune=0 --svt scd=0 ... --enc af=loudnorm as example is meant for ffmpeg

the behavior isn't consistent between SVT-AV1 and other encoders

That is because libsvtav1 is the default used encoder. Use ab-av1 auto-encode --help to see the defaults.

mr44er avatar Mar 17 '23 01:03 mr44er

Thanks for raising this, it's mostly setup to use --svt for these args. I agree that with your usage the behaviour is surprising.

We could:

  • Make user specified --enc svtav1-params=... override any default params.
  • Fail if using this and --svt.

Or alternatively just ban svtav1-params usage, which is simpler. This might be better since it nudges users to the easier to use API.

Also note, since you used svtav1 "keyint" param, --keyint arg handles this (setting ffmpeg -g) and defaults to 10s.

Regarding --scd it probably is worth removing this as a first class option & default behaviour.

alexheretic avatar Mar 17 '23 08:03 alexheretic

I'd prefer being able to use --enc svtav1-params for consistency between encoders and easier scripting. IMO svtav1-params is easier to remember once you're using multiple encoders and setting various encoder parameters with the -{encoder}-params switch. It also makes scripting easier, since FFmpeg has kept the naming of the switch consistent between encoders.

veikk0 avatar Mar 19 '23 19:03 veikk0

I guess the first solution would satisfy that?

  • Make user specified --enc svtav1-params=... override any default params.
  • Fail if using this and --svt.

alexheretic avatar Mar 20 '23 09:03 alexheretic

Yes, it would.

veikk0 avatar Mar 22 '23 04:03 veikk0