End-of-Eternity / EoEfunc

8 stars 2 forks source link

raise on older mvtools #2

Closed RivenSkaye closed 2 years ago

RivenSkaye commented 2 years ago

This line currently prints a warning and carries on, but something in the code is causing a silent failure with any combination of args including either refine = 6 or tr > 3 when a more recent mvtools is not available. Expected behavior would be either falling back and warning the user that it's going with MVMode.INTEGER, or raising to notify the user something breaks.

Proposed fallback would be something like

print(
    "CMDegrain: Using older mvsf. Building"
    " https://github.com/IFeelBloated/vapoursynth-mvtools-sf from master is"
    " recommended. Adjusting values tr <= 3 and refine <= 5.",
    file=sys.stderr,
)
tr = 3 if tr > 3 else tr
refine = 5 if refine > 5 else refine
mvmode = MVMode.INTEGER

Alternatively

raise ImportError(
    "tr > 3 and refine > 5 can't be used without a newer build of mvtools. "
    "Please build https://github.com/IFeelBloated/vapoursynth-mvtools-sf "
    "yourself or ask around if someone else has a build for you."
)