proxy ¶
Classes:
Functions:
-
clear_cache– -
get_policy–Retrieve the currently active VapourSynth EnvironmentPolicy.
-
get_policy_api–Retrieve the VapourSynth EnvironmentPolicyAPI bound to the currently registered policy.
-
has_environment–Check if the current thread is running inside an environment.
-
register_on_creation–Register a callback on every core creation.
-
unregister_on_creation–Unregister this callback from every core creation.
Attributes:
-
GRAY10– -
GRAY11– -
GRAY12– -
GRAY13– -
GRAY14– -
GRAY15– -
GRAY16– -
GRAY17– -
GRAY18– -
GRAY19– -
GRAY20– -
GRAY21– -
GRAY22– -
GRAY23– -
GRAY24– -
GRAY25– -
GRAY26– -
GRAY27– -
GRAY28– -
GRAY29– -
GRAY30– -
GRAY31– -
GRAY32– -
GRAY8– -
GRAY9– -
GRAYH– -
GRAYS– -
RGB24– -
RGB27– -
RGB30– -
RGB33– -
RGB36– -
RGB39– -
RGB42– -
RGB45– -
RGB48– -
RGB51– -
RGB54– -
RGB57– -
RGB60– -
RGB63– -
RGB66– -
RGB69– -
RGB72– -
RGB75– -
RGB78– -
RGB81– -
RGB84– -
RGB87– -
RGB90– -
RGB93– -
RGB96– -
RGBH– -
RGBS– -
YUV410P10– -
YUV410P11– -
YUV410P12– -
YUV410P13– -
YUV410P14– -
YUV410P15– -
YUV410P16– -
YUV410P17– -
YUV410P18– -
YUV410P19– -
YUV410P20– -
YUV410P21– -
YUV410P22– -
YUV410P23– -
YUV410P24– -
YUV410P25– -
YUV410P26– -
YUV410P27– -
YUV410P28– -
YUV410P29– -
YUV410P30– -
YUV410P31– -
YUV410P32– -
YUV410P8– -
YUV410P9– -
YUV410PH– -
YUV410PS– -
YUV411P10– -
YUV411P11– -
YUV411P12– -
YUV411P13– -
YUV411P14– -
YUV411P15– -
YUV411P16– -
YUV411P17– -
YUV411P18– -
YUV411P19– -
YUV411P20– -
YUV411P21– -
YUV411P22– -
YUV411P23– -
YUV411P24– -
YUV411P25– -
YUV411P26– -
YUV411P27– -
YUV411P28– -
YUV411P29– -
YUV411P30– -
YUV411P31– -
YUV411P32– -
YUV411P8– -
YUV411P9– -
YUV411PH– -
YUV411PS– -
YUV420P10– -
YUV420P11– -
YUV420P12– -
YUV420P13– -
YUV420P14– -
YUV420P15– -
YUV420P16– -
YUV420P17– -
YUV420P18– -
YUV420P19– -
YUV420P20– -
YUV420P21– -
YUV420P22– -
YUV420P23– -
YUV420P24– -
YUV420P25– -
YUV420P26– -
YUV420P27– -
YUV420P28– -
YUV420P29– -
YUV420P30– -
YUV420P31– -
YUV420P32– -
YUV420P8– -
YUV420P9– -
YUV420PH– -
YUV420PS– -
YUV422P10– -
YUV422P11– -
YUV422P12– -
YUV422P13– -
YUV422P14– -
YUV422P15– -
YUV422P16– -
YUV422P17– -
YUV422P18– -
YUV422P19– -
YUV422P20– -
YUV422P21– -
YUV422P22– -
YUV422P23– -
YUV422P24– -
YUV422P25– -
YUV422P26– -
YUV422P27– -
YUV422P28– -
YUV422P29– -
YUV422P30– -
YUV422P31– -
YUV422P32– -
YUV422P8– -
YUV422P9– -
YUV422PH– -
YUV422PS– -
YUV440P10– -
YUV440P11– -
YUV440P12– -
YUV440P13– -
YUV440P14– -
YUV440P15– -
YUV440P16– -
YUV440P17– -
YUV440P18– -
YUV440P19– -
YUV440P20– -
YUV440P21– -
YUV440P22– -
YUV440P23– -
YUV440P24– -
YUV440P25– -
YUV440P26– -
YUV440P27– -
YUV440P28– -
YUV440P29– -
YUV440P30– -
YUV440P31– -
YUV440P32– -
YUV440P8– -
YUV440P9– -
YUV440PH– -
YUV440PS– -
YUV444P10– -
YUV444P11– -
YUV444P12– -
YUV444P13– -
YUV444P14– -
YUV444P15– -
YUV444P16– -
YUV444P17– -
YUV444P18– -
YUV444P19– -
YUV444P20– -
YUV444P21– -
YUV444P22– -
YUV444P23– -
YUV444P24– -
YUV444P25– -
YUV444P26– -
YUV444P27– -
YUV444P28– -
YUV444P29– -
YUV444P30– -
YUV444P31– -
YUV444P32– -
YUV444P8– -
YUV444P9– -
YUV444PH– -
YUV444PS– -
core–The singleton Core object.
CoreProxy ¶
CoreProxy(core: Core | None, vs_proxy: VSCoreProxy, lazy: bool)
Bases: _CoreProxyBase
A lazy proxy wrapper for the VapourSynth Core.
Supports deferred, lazy retrieval of plugins and functions to prevent premature core initialization and facilitate safe reference holding.
Attributes:
-
lazy–
Source code in vstools/vs_proxy/proxy.py
1033 1034 1035 | |
EnvironmentProxy ¶
Bases: _EnvironmentProxyBase
A proxy wrapper around the active VapourSynth Environment.
Attributes:
FunctionProxy ¶
FunctionProxy(plugin: PluginProxy, func_name: str)
Bases: _FunctionProxyBase
A lazy proxy wrapper for a VapourSynth plugin function.
Defers lookup and resolution of the underlying function until it is called or its attributes are accessed.
Methods:
-
__call__–
Source code in vstools/vs_proxy/proxy.py
972 973 | |
PluginProxy ¶
Bases: _PluginProxyBase
A lazy proxy wrapper for a VapourSynth plugin.
Delegates attribute lookup to return a FunctionProxy or resolve the underlying VapourSynth Plugin's functions dynamically.
Source code in vstools/vs_proxy/proxy.py
1004 1005 | |
PresetVideoFormat ¶
Bases: IntEnum
Attributes:
-
GRAY10– -
GRAY11– -
GRAY12– -
GRAY13– -
GRAY14– -
GRAY15– -
GRAY16– -
GRAY17– -
GRAY18– -
GRAY19– -
GRAY20– -
GRAY21– -
GRAY22– -
GRAY23– -
GRAY24– -
GRAY25– -
GRAY26– -
GRAY27– -
GRAY28– -
GRAY29– -
GRAY30– -
GRAY31– -
GRAY32– -
GRAY8– -
GRAY9– -
GRAYH– -
GRAYS– -
NONE– -
RGB24– -
RGB27– -
RGB30– -
RGB33– -
RGB36– -
RGB39– -
RGB42– -
RGB45– -
RGB48– -
RGB51– -
RGB54– -
RGB57– -
RGB60– -
RGB63– -
RGB66– -
RGB69– -
RGB72– -
RGB75– -
RGB78– -
RGB81– -
RGB84– -
RGB87– -
RGB90– -
RGB93– -
RGB96– -
RGBH– -
RGBS– -
YUV410P10– -
YUV410P11– -
YUV410P12– -
YUV410P13– -
YUV410P14– -
YUV410P15– -
YUV410P16– -
YUV410P17– -
YUV410P18– -
YUV410P19– -
YUV410P20– -
YUV410P21– -
YUV410P22– -
YUV410P23– -
YUV410P24– -
YUV410P25– -
YUV410P26– -
YUV410P27– -
YUV410P28– -
YUV410P29– -
YUV410P30– -
YUV410P31– -
YUV410P32– -
YUV410P8– -
YUV410P9– -
YUV410PH– -
YUV410PS– -
YUV411P10– -
YUV411P11– -
YUV411P12– -
YUV411P13– -
YUV411P14– -
YUV411P15– -
YUV411P16– -
YUV411P17– -
YUV411P18– -
YUV411P19– -
YUV411P20– -
YUV411P21– -
YUV411P22– -
YUV411P23– -
YUV411P24– -
YUV411P25– -
YUV411P26– -
YUV411P27– -
YUV411P28– -
YUV411P29– -
YUV411P30– -
YUV411P31– -
YUV411P32– -
YUV411P8– -
YUV411P9– -
YUV411PH– -
YUV411PS– -
YUV420P10– -
YUV420P11– -
YUV420P12– -
YUV420P13– -
YUV420P14– -
YUV420P15– -
YUV420P16– -
YUV420P17– -
YUV420P18– -
YUV420P19– -
YUV420P20– -
YUV420P21– -
YUV420P22– -
YUV420P23– -
YUV420P24– -
YUV420P25– -
YUV420P26– -
YUV420P27– -
YUV420P28– -
YUV420P29– -
YUV420P30– -
YUV420P31– -
YUV420P32– -
YUV420P8– -
YUV420P9– -
YUV420PH– -
YUV420PS– -
YUV422P10– -
YUV422P11– -
YUV422P12– -
YUV422P13– -
YUV422P14– -
YUV422P15– -
YUV422P16– -
YUV422P17– -
YUV422P18– -
YUV422P19– -
YUV422P20– -
YUV422P21– -
YUV422P22– -
YUV422P23– -
YUV422P24– -
YUV422P25– -
YUV422P26– -
YUV422P27– -
YUV422P28– -
YUV422P29– -
YUV422P30– -
YUV422P31– -
YUV422P32– -
YUV422P8– -
YUV422P9– -
YUV422PH– -
YUV422PS– -
YUV440P10– -
YUV440P11– -
YUV440P12– -
YUV440P13– -
YUV440P14– -
YUV440P15– -
YUV440P16– -
YUV440P17– -
YUV440P18– -
YUV440P19– -
YUV440P20– -
YUV440P21– -
YUV440P22– -
YUV440P23– -
YUV440P24– -
YUV440P25– -
YUV440P26– -
YUV440P27– -
YUV440P28– -
YUV440P29– -
YUV440P30– -
YUV440P31– -
YUV440P32– -
YUV440P8– -
YUV440P9– -
YUV440PH– -
YUV440PS– -
YUV444P10– -
YUV444P11– -
YUV444P12– -
YUV444P13– -
YUV444P14– -
YUV444P15– -
YUV444P16– -
YUV444P17– -
YUV444P18– -
YUV444P19– -
YUV444P20– -
YUV444P21– -
YUV444P22– -
YUV444P23– -
YUV444P24– -
YUV444P25– -
YUV444P26– -
YUV444P27– -
YUV444P28– -
YUV444P29– -
YUV444P30– -
YUV444P31– -
YUV444P32– -
YUV444P8– -
YUV444P9– -
YUV444PH– -
YUV444PS–
VSCoreProxy ¶
VSCoreProxy(core: Core | None = None)
Bases: _CoreProxyBase
Class for wrapping a VapourSynth core.
Methods:
-
register_on_destroy– -
set_affinity–Configure CPU core affinity and cache settings for VapourSynth.
-
unregister_on_destroy–
Attributes:
-
active(bool) –Check if the VapourSynth Core has already been instantiated.
-
core(Core) –The underlying VapourSynth Core instance.
-
core_id(int) –The unique integer identifier of the active VapourSynth Core.
-
env(EnvironmentProxy) –The EnvironmentProxy singleton representing the current environment execution context.
-
lazy(CoreProxy) –A
CoreProxywith no initialCorereference. -
proxied(CoreProxy) –A
CoreProxybacked by a weak reference to the currentCore.
Source code in vstools/vs_proxy/proxy.py
1110 1111 1112 | |
active property ¶
active: bool
Check if the VapourSynth Core has already been instantiated.
A core is active if we have a direct/owned Core instance, or if a registered policy environment exists and already has an initialized Core.
core_id property ¶
core_id: int
The unique integer identifier of the active VapourSynth Core.
Raises:
-
CustomRuntimeError–If the Core has not been instantiated yet.
env property ¶
env: EnvironmentProxy
The EnvironmentProxy singleton representing the current environment execution context.
Raises:
-
CustomRuntimeError–If a policy has not been registered.
lazy property ¶
lazy: CoreProxy
A CoreProxy with no initial Core reference.
Like proxied, plugins and functions are lazily resolved, but attribute access alone will never trigger core creation. A Core is only instantiated when a resolved function is actually invoked.
Use this when you need to set class-level defaults.
proxied property ¶
proxied: CoreProxy
A CoreProxy backed by a weak reference to the current Core.
Plugins and functions are lazily resolved, so it's safe to hold references at class or module level (e.g. BlankClip = core.proxied.std.BlankClip).
If the underlying Core is freed and a new one is created, the proxy transparently falls back to the new core on next access.
Accessing this property may trigger core creation if no core exists yet.
register_on_destroy ¶
register_on_destroy(callback: Callable[[], None]) -> None
Source code in vstools/vs_proxy/proxy.py
1203 1204 1205 | |
set_affinity ¶
set_affinity(
threads: int | float | range | tuple[int, int] | list[int] | None = None,
max_cache: int | None = None,
reserve: Iterable[int] | None = None,
) -> None
Configure CPU core affinity and cache settings for VapourSynth.
This function selects which CPU cores the current process is allowed to run on, and configures the number of worker threads used by VapourSynth. It also allows tuning of the frame buffer cache.
Parameters:
-
(threads¶int | float | range | tuple[int, int] | list[int] | None, default:None) –Defines how many and which CPU cores to use.
Accepted formats:
None: Use all available CPU cores.int: Use cores0throughthreads - 1.float: A fraction of available cores (e.g.,0.5= half the cores).range: Use the specified range of cores.tuple[int, int]: Equivalent torange(start, stop).list[int]: Explicit list of core indices.
-
(max_cache¶int | None, default:None) –Maximum VapourSynth frame buffer cache size, in megabytes. If
None, the default setting is preserved.
Raises:
-
CustomValueError–If
threadsis lower than or equal to 0.
Source code in vstools/vs_proxy/proxy.py
1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | |
unregister_on_destroy ¶
unregister_on_destroy(callback: Callable[[], None]) -> None
Source code in vstools/vs_proxy/proxy.py
1207 1208 1209 | |
clear_cache ¶
clear_cache() -> None
Source code in vstools/vs_proxy/proxy.py
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | |
get_policy ¶
get_policy() -> (
EnvironmentPolicy | VSScriptEnvironmentPolicy | StandaloneEnvironmentPolicy
)
Retrieve the currently active VapourSynth EnvironmentPolicy.
Source code in vstools/vs_proxy/proxy.py
874 875 876 877 878 879 880 881 882 883 884 | |
get_policy_api ¶
get_policy_api() -> EnvironmentPolicyAPI
Retrieve the VapourSynth EnvironmentPolicyAPI bound to the currently registered policy.
Source code in vstools/vs_proxy/proxy.py
887 888 889 890 891 892 893 894 | |
has_environment ¶
has_environment() -> bool
Check if the current thread is running inside an environment.
Source code in vstools/vs_proxy/proxy.py
866 867 868 869 870 871 | |
register_on_creation ¶
Register a callback on every core creation.
Note
Callbacks are stored using weak references to prevent memory leaks from dynamic closures and bound methods. If you pass an inline lambda, transient bound method, or dynamically created function, it will be immediately garbage-collected and will not run.
To prevent this:
- Use module-level functions (which are strongly referenced by the module).
- Keep a strong reference to the callback elsewhere (e.g. store it as an attribute on a persistent object).
Returns whether the callback was executed immediately because a core is already active.
Source code in vstools/vs_proxy/proxy.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 | |
unregister_on_creation ¶
Unregister this callback from every core creation.
Returns whether the callback was successfully unregistered.
Source code in vstools/vs_proxy/proxy.py
835 836 837 838 839 840 841 842 843 844 845 846 | |