YomikoR / VapourSynth-Editor

Branch vse-previewer for standalone previewer. Branch vs-api4 for an IDE with a text editor. Branch master for "stability". Forked from https://bitbucket.org/mystery_keeper/vapoursynth-editor
Other
139 stars 9 forks source link

Expr Crash #40

Closed nobananasforyou closed 1 year ago

nobananasforyou commented 1 year ago

Hi!

VsEdit keeps crashing and I get the following error: setVideoInfo: The VSVideoFormat pointer passed by Expr was not obtained from registerFormat() or getFormatPreset() setVideoInfo: The VSVideoFormat pointer passed by Expr was not obtained from registerFormat() or getFormatPreset()

Could possibly be because the script below utilizes akarin.Expr.

Script: import vapoursynth as vs from vsutil import depth from vsdehalo import fine_dehalo, YAHR, edge_cleaner core = vs.core

src = core.d2v.Source(r'saz_v1_01.d2v') src = src.vivtc.VFM(order=1, scthresh=8, cthresh=8).vivtc.VDecimate() src = depth(src, 16) src = edge_cleaner(src) src = YAHR(src, expand=3) src = fine_dehalo(src, darkstr=0) src.set_output()

YomikoR commented 1 year ago

Are you using IEW packages with the latest versions?

nobananasforyou commented 1 year ago

Yes

YomikoR commented 1 year ago

Formerly there was an issue in vs-kernels (see https://github.com/vapoursynth/vapoursynth/issues/897#issuecomment-1235290602). To make things clearer, VSEditor relies on vsscript, a component of VapourSynth, to evaluate .vpy scripts, which loads a python library and won't unload it. By keeping a reference of VS core in a python module, the core is never freed when script evaluation ends, causing a conflict on the second evaluation (same python, same core, but different environment).

To address this issue, the maintainers of IEW packages added some mechanism to detect such environment change (see vs_proxy.py in vs-tools), and prevent the script evaluation from working on, instead of letting VS crash. This probably affects VSEditor, vspreview-rs and Wobbly. The python based vspreview is different, as the VS core can be safely reused.

Unfortunately, when multiple references of VS core are kept, VS crashes even before their detection works.