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
Unable to add blur filter with max matrix size #4259
Comments
AnalysisThe FFmpeg unsharp filter documentation indicates 23 is the maximum value permitted:
IINA is enforcing the minimum and maximum values: // blur
FilterPreset("blur", params: [
"amount": PM.float(min: 0, max: 1.5),
"msize": PM.int(min: 3, max: 23, step: 2, defaultValue: 5)
]) { instance in
return MPVFilter.unsharp(amount: -instance.value(for: "amount").floatValue,
msize: instance.value(for: "msize").intValue)
}, The FFmpeg code generating the error looks like: if (s->luma.scalebits >= 26 || s->chroma.scalebits >= 26 || s->alpha.scalebits >= 26) {
av_log(ctx, AV_LOG_ERROR, "luma or chroma or alpha matrix size too big\n");
return AVERROR(EINVAL);
} The error message is slightly different because FFmpeg has added an alpha parameter to this filter. The code calculating fp->steps_x = msize_x / 2;
fp->steps_y = msize_y / 2;
fp->scalebits = (fp->steps_x + fp->steps_y) * 2; The FFmpeg documentation does not mention that if both the horizontal and the vertical size are set to their maximum values this restriction on the combined size will be exceeded. |
This commit will change the construction of the sharpen and blur FilterPreset objects to impose a maximum value of 13 for the matrix size in order to adhere to the undocumented FFmpeg limit on the sum of the unsharp luma matrix horizontal and vertical matrix sizes.
This commit will change the construction of the sharpen and blur FilterPreset objects to impose a maximum value of 13 for the matrix size in order to adhere to the undocumented FFmpeg limit on the sum of the unsharp luma matrix horizontal and vertical matrix sizes.
IINA 1.3.2 contains the fix for this issue. |
System and IINA version:
Expected behavior:
The matrix size slider for a blur filter only permits setting valid values.
Actual behavior:
Attempts to add a
Blur
filter with theMatrix size
slider knob moved all the way to the right:Fail reporting
Error occured when setting filters. Please check our parameter format
:IINA log:
mpv log:
Steps to reproduce:
Video filters…
under theVideo
menuVideo Filters
window click+
Blur
Matrix size
slider knob all the way to the rightAdd
buttonThis is an IINA problem.
How often does this happen?
Every time.
The text was updated successfully, but these errors were encountered: