Closed Werve closed 1 year ago
And according to this https://github.com/master-of-zen/Av1an/blob/master/docs/TargetQuality.md seems it is not needed the --crf arg using Target VMAF so that allows faster encoding and smaller output filesize.
Good job on figuring out why it wasn't working...
But I'm gonna fix the horrible code layout in VideoEncodersBin.cs.
Tons of copy-pasted stuff when you could've used conditions inside interpolated strings.
Though a lot of this encoder shit needs refactoring later, the inheritance based classes were not a good idea
For example, I cleaned up this:
if (vmaf)
{
return new CodecArgs($" -e aom -v \" " +
$"--cpu-used={preset} " +
$"--disable-kf --kf-min-dist=12 --kf-max-dist={g} " +
$"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} " +
$"{colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}");
}
else
{
return new CodecArgs($" -e aom -v \" " +
$"--end-usage=q --cpu-used={preset} --cq-level={q} " +
$"--disable-kf --kf-min-dist=12 --kf-max-dist={g} " +
$"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} " +
$"{colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}");
}
to this:
return new CodecArgs($" -e aom -v \" {(!vmaf ? $"--end-usage=q --cq-level={q}" : "")} --cpu-used={preset} --disable-kf --kf-min-dist=12 --kf-max-dist={g} " +
$"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} {colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}");
But again the whole thing could need some refactoring, these args would be prettier in a List or Dictionary...
For example, I cleaned up this:
if (vmaf) { return new CodecArgs($" -e aom -v \" " + $"--cpu-used={preset} " + $"--disable-kf --kf-min-dist=12 --kf-max-dist={g} " + $"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} " + $"{colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}"); } else { return new CodecArgs($" -e aom -v \" " + $"--end-usage=q --cpu-used={preset} --cq-level={q} " + $"--disable-kf --kf-min-dist=12 --kf-max-dist={g} " + $"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} " + $"{colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}"); }
to this:
return new CodecArgs($" -e aom -v \" {(!vmaf ? $"--end-usage=q --cq-level={q}" : "")} --cpu-used={preset} --disable-kf --kf-min-dist=12 --kf-max-dist={g} " + $"--enable-dnl-denoising={denoise} --denoise-noise-level={grain} {colors} --threads={thr} {tiles} {adv} {cust} \" --pix-format {pixFmt}");
Yes it is much better, actually I have always proceeded in a more schematic way. Thank you for sharing that.
However, I noticed that although the encoding now completes correctly the final video file still seems to have the same VMAF quality as if it had been encoded with --crf
ignoring --target-vamf
. Maybe it is a problem with av1an, I am testing.
I confirm the latest av1an ignore the--target-vmaf
arg. The 0.4.0 release version works.
https://github.com/master-of-zen/Av1an/issues/719
If I understand it right
encQualModeBox.SelectedIndex
should be about the UI of the QuickConvert tab not Av1An. So I modified it, and now finally the encoding with svt-av1 also updated, works. https://github.com/n00mkrad/nmkoder/issues/36