Skip to content

Commit 8f62c15

Browse files
authored
Merge pull request #6 from stuxcrystal/patch-1
Update getnative.py
2 parents b951778 + 13fbd31 commit 8f62c15

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

getnative.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,19 @@ def _getnative():
342342
elif args.mode != "bilinear": # ELIF is needed for bl-bc run
343343
getnative(args, src, None)
344344

345+
def _vpy_source_filter(path):
346+
import runpy
347+
runpy.run_path(path, {}, "__vapoursynth__")
348+
return vapoursynth.get_output(0)
345349

346350
def _get_source_filter(args):
347351
ext = os.path.splitext(args.input_file)[1].lower()
348352
if imwri and (args.img or ext in {".png", ".tif", ".tiff", ".bmp", ".jpg", ".jpeg", ".webp", ".tga", ".jp2"}):
349353
print("Using imwri as source filter")
350354
return imwri.Read
355+
if ext in {".py", ".pyw", ".vpy"}:
356+
print("Using custom VapourSynth script as a source. This may cause garbage results. Only do this if you know what you are doing.")
357+
return _vpy_source_filter
351358
source_filter = _get_attr(core, 'ffms2.Source')
352359
if source_filter:
353360
print("Using ffms2 as source filter")

0 commit comments

Comments
 (0)