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

Fix Target VMAF svt-av1 crf range error #44

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Conversation

Werve
Copy link
Contributor

@Werve Werve commented Feb 21, 2023

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.
#36

@Werve
Copy link
Contributor Author

Werve commented Feb 21, 2023

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.

@n00mkrad
Copy link
Owner

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.

@n00mkrad
Copy link
Owner

Though a lot of this encoder shit needs refactoring later, the inheritance based classes were not a good idea

@n00mkrad n00mkrad merged commit fc16821 into n00mkrad:master Feb 22, 2023
@n00mkrad
Copy link
Owner

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}");

@n00mkrad
Copy link
Owner

But again the whole thing could need some refactoring, these args would be prettier in a List or Dictionary...

@Werve
Copy link
Contributor Author

Werve commented Feb 22, 2023

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.

@Werve
Copy link
Contributor Author

Werve commented Feb 22, 2023

I confirm the latest av1an ignore the --target-vmaf arg. The 0.4.0 release version works.
master-of-zen/Av1an#719

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

Successfully merging this pull request may close these issues.

2 participants