Skip to content

Commit

Permalink
dynamic_scene_adaptive_grain: tmpfile -> Keyframes.unique
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Dec 5, 2023
1 parent 09a8c2e commit 6926be9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lvsfunc/grain.py
@@ -1,7 +1,6 @@
from tempfile import NamedTemporaryFile
from warnings import warn

from stgpytools import CustomImportError, DependencyNotFoundError, MismatchRefError, SPath
from stgpytools import CustomImportError, DependencyNotFoundError, MismatchRefError, get_script_path
from vstools import Keyframes, find_prop_rfs, merge_clip_props, vs


Expand Down Expand Up @@ -63,14 +62,7 @@ def dynamic_scene_adaptive_grain(

ref = grain_bright

if keyframes is None:
with NamedTemporaryFile(delete=False) as tmp:
tmp_file = SPath(tmp.name)

if tmp_file.exists():
keyframes = Keyframes.from_file(tmp_file)
else:
keyframes = Keyframes.from_clip(ref)
keyframes = keyframes or Keyframes.unique(ref, get_script_path().stem)

ref = SceneAverageStats(ref, keyframes, "SceneStatsGrain")

Expand Down

0 comments on commit 6926be9

Please sign in to comment.