Skip to content

proxy

Classes:

Functions:

Attributes:

GRAY10 module-attribute

GRAY11 module-attribute

GRAY12 module-attribute

GRAY13 module-attribute

GRAY14 module-attribute

GRAY15 module-attribute

GRAY16 module-attribute

GRAY17 module-attribute

GRAY18 module-attribute

GRAY19 module-attribute

GRAY20 module-attribute

GRAY21 module-attribute

GRAY22 module-attribute

GRAY23 module-attribute

GRAY24 module-attribute

GRAY25 module-attribute

GRAY26 module-attribute

GRAY27 module-attribute

GRAY28 module-attribute

GRAY29 module-attribute

GRAY30 module-attribute

GRAY31 module-attribute

GRAY32 module-attribute

GRAY8 module-attribute

GRAY9 module-attribute

GRAYH module-attribute

GRAYS module-attribute

RGB24 module-attribute

RGB27 module-attribute

RGB30 module-attribute

RGB33 module-attribute

RGB36 module-attribute

RGB39 module-attribute

RGB42 module-attribute

RGB45 module-attribute

RGB48 module-attribute

RGB51 module-attribute

RGB54 module-attribute

RGB57 module-attribute

RGB60 module-attribute

RGB63 module-attribute

RGB66 module-attribute

RGB69 module-attribute

RGB72 module-attribute

RGB75 module-attribute

RGB78 module-attribute

RGB81 module-attribute

RGB84 module-attribute

RGB87 module-attribute

RGB90 module-attribute

RGB93 module-attribute

RGB96 module-attribute

RGBH module-attribute

RGBS module-attribute

YUV410P10 module-attribute

YUV410P11 module-attribute

YUV410P12 module-attribute

YUV410P13 module-attribute

YUV410P14 module-attribute

YUV410P15 module-attribute

YUV410P16 module-attribute

YUV410P17 module-attribute

YUV410P18 module-attribute

YUV410P19 module-attribute

YUV410P20 module-attribute

YUV410P21 module-attribute

YUV410P22 module-attribute

YUV410P23 module-attribute

YUV410P24 module-attribute

YUV410P25 module-attribute

YUV410P26 module-attribute

YUV410P27 module-attribute

YUV410P28 module-attribute

YUV410P29 module-attribute

YUV410P30 module-attribute

YUV410P31 module-attribute

YUV410P32 module-attribute

YUV410P8 module-attribute

YUV410P9 module-attribute

YUV410PH module-attribute

YUV410PS module-attribute

YUV411P10 module-attribute

YUV411P11 module-attribute

YUV411P12 module-attribute

YUV411P13 module-attribute

YUV411P14 module-attribute

YUV411P15 module-attribute

YUV411P16 module-attribute

YUV411P17 module-attribute

YUV411P18 module-attribute

YUV411P19 module-attribute

YUV411P20 module-attribute

YUV411P21 module-attribute

YUV411P22 module-attribute

YUV411P23 module-attribute

YUV411P24 module-attribute

YUV411P25 module-attribute

YUV411P26 module-attribute

YUV411P27 module-attribute

YUV411P28 module-attribute

YUV411P29 module-attribute

YUV411P30 module-attribute

YUV411P31 module-attribute

YUV411P32 module-attribute

YUV411P8 module-attribute

YUV411P9 module-attribute

YUV411PH module-attribute

YUV411PS module-attribute

YUV420P10 module-attribute

YUV420P11 module-attribute

YUV420P12 module-attribute

YUV420P13 module-attribute

YUV420P14 module-attribute

YUV420P15 module-attribute

YUV420P16 module-attribute

YUV420P17 module-attribute

YUV420P18 module-attribute

YUV420P19 module-attribute

YUV420P20 module-attribute

YUV420P21 module-attribute

YUV420P22 module-attribute

YUV420P23 module-attribute

YUV420P24 module-attribute

YUV420P25 module-attribute

YUV420P26 module-attribute

YUV420P27 module-attribute

YUV420P28 module-attribute

YUV420P29 module-attribute

YUV420P30 module-attribute

YUV420P31 module-attribute

YUV420P32 module-attribute

YUV420P8 module-attribute

YUV420P9 module-attribute

YUV420PH module-attribute

YUV420PS module-attribute

YUV422P10 module-attribute

YUV422P11 module-attribute

YUV422P12 module-attribute

YUV422P13 module-attribute

YUV422P14 module-attribute

YUV422P15 module-attribute

YUV422P16 module-attribute

YUV422P17 module-attribute

YUV422P18 module-attribute

YUV422P19 module-attribute

YUV422P20 module-attribute

YUV422P21 module-attribute

YUV422P22 module-attribute

YUV422P23 module-attribute

YUV422P24 module-attribute

YUV422P25 module-attribute

YUV422P26 module-attribute

YUV422P27 module-attribute

YUV422P28 module-attribute

YUV422P29 module-attribute

YUV422P30 module-attribute

YUV422P31 module-attribute

YUV422P32 module-attribute

YUV422P8 module-attribute

YUV422P9 module-attribute

YUV422PH module-attribute

YUV422PS module-attribute

YUV440P10 module-attribute

YUV440P11 module-attribute

YUV440P12 module-attribute

YUV440P13 module-attribute

YUV440P14 module-attribute

YUV440P15 module-attribute

YUV440P16 module-attribute

YUV440P17 module-attribute

YUV440P18 module-attribute

YUV440P19 module-attribute

YUV440P20 module-attribute

YUV440P21 module-attribute

YUV440P22 module-attribute

YUV440P23 module-attribute

YUV440P24 module-attribute

YUV440P25 module-attribute

YUV440P26 module-attribute

YUV440P27 module-attribute

YUV440P28 module-attribute

YUV440P29 module-attribute

YUV440P30 module-attribute

YUV440P31 module-attribute

YUV440P32 module-attribute

YUV440P8 module-attribute

YUV440P9 module-attribute

YUV440PH module-attribute

YUV440PS module-attribute

YUV444P10 module-attribute

YUV444P11 module-attribute

YUV444P12 module-attribute

YUV444P13 module-attribute

YUV444P14 module-attribute

YUV444P15 module-attribute

YUV444P16 module-attribute

YUV444P17 module-attribute

YUV444P18 module-attribute

YUV444P19 module-attribute

YUV444P20 module-attribute

YUV444P21 module-attribute

YUV444P22 module-attribute

YUV444P23 module-attribute

YUV444P24 module-attribute

YUV444P25 module-attribute

YUV444P26 module-attribute

YUV444P27 module-attribute

YUV444P28 module-attribute

YUV444P29 module-attribute

YUV444P30 module-attribute

YUV444P31 module-attribute

YUV444P32 module-attribute

YUV444P8 module-attribute

YUV444P9 module-attribute

YUV444PH module-attribute

YUV444PS module-attribute

core module-attribute

core = VSCoreProxy()

The singleton Core object.

entry_filename module-attribute

entry_filename = frame.f_code.co_filename

frame module-attribute

frame = frame.f_back

script_path module-attribute

script_path = Path(entry_filename).resolve()

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:

Source code in vstools/vs_proxy/proxy.py
1033
1034
1035
def __init__(self, core: Core | None, vs_proxy: VSCoreProxy, lazy: bool) -> None:
    self.lazy = lazy
    self.__dict__["vs_core_ref"] = (core and weakref.ref(core), vs_proxy)

lazy instance-attribute

lazy = lazy

EnvironmentProxy

Bases: _EnvironmentProxyBase

A proxy wrapper around the active VapourSynth Environment.

Attributes:

  • api (EnvironmentPolicyAPI) –
  • data (EnvironmentData) –

    Retrieve the underlying EnvironmentData object.

  • has_core (bool) –

    Check if the active EnvironmentData has an instantiated VapourSynth Core.

  • policy (EnvironmentPolicy | VSScriptEnvironmentPolicy | StandaloneEnvironmentPolicy) –

api property

api: EnvironmentPolicyAPI

data property

data: EnvironmentData

Retrieve the underlying EnvironmentData object.

has_core property

has_core: bool

Check if the active EnvironmentData has an instantiated VapourSynth Core.

This avoids triggering the lazy creation of the Core.

policy property

policy: (
    EnvironmentPolicy | VSScriptEnvironmentPolicy | StandaloneEnvironmentPolicy
)

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:

Source code in vstools/vs_proxy/proxy.py
972
973
def __init__(self, plugin: PluginProxy, func_name: str) -> None:
    self.__dict__["func_ref"] = (plugin, func_name)

__call__

__call__(*args: Any, **kwargs: Any) -> Any
Source code in vstools/vs_proxy/proxy.py
980
981
def __call__(self, *args: Any, **kwargs: Any) -> Any:
    return self._vs_function(*args, **kwargs)

PluginProxy

PluginProxy(core: CoreProxy, namespace: str)

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
def __init__(self, core: CoreProxy, namespace: str) -> None:
    self.__dict__["plugin_ref"] = (core, namespace)

PresetVideoFormat

Bases: IntEnum

Attributes:

GRAY10 class-attribute instance-attribute

GRAY10 = VSPresetVideoFormat.GRAY10

GRAY11 class-attribute instance-attribute

GRAY11 = _make_video_id(GRAY, INTEGER, 11, 0, 0)

GRAY12 class-attribute instance-attribute

GRAY12 = VSPresetVideoFormat.GRAY12

GRAY13 class-attribute instance-attribute

GRAY13 = _make_video_id(GRAY, INTEGER, 13, 0, 0)

GRAY14 class-attribute instance-attribute

GRAY14 = VSPresetVideoFormat.GRAY14

GRAY15 class-attribute instance-attribute

GRAY15 = _make_video_id(GRAY, INTEGER, 15, 0, 0)

GRAY16 class-attribute instance-attribute

GRAY16 = VSPresetVideoFormat.GRAY16

GRAY17 class-attribute instance-attribute

GRAY17 = _make_video_id(GRAY, INTEGER, 17, 0, 0)

GRAY18 class-attribute instance-attribute

GRAY18 = _make_video_id(GRAY, INTEGER, 18, 0, 0)

GRAY19 class-attribute instance-attribute

GRAY19 = _make_video_id(GRAY, INTEGER, 19, 0, 0)

GRAY20 class-attribute instance-attribute

GRAY20 = _make_video_id(GRAY, INTEGER, 20, 0, 0)

GRAY21 class-attribute instance-attribute

GRAY21 = _make_video_id(GRAY, INTEGER, 21, 0, 0)

GRAY22 class-attribute instance-attribute

GRAY22 = _make_video_id(GRAY, INTEGER, 22, 0, 0)

GRAY23 class-attribute instance-attribute

GRAY23 = _make_video_id(GRAY, INTEGER, 23, 0, 0)

GRAY24 class-attribute instance-attribute

GRAY24 = _make_video_id(GRAY, INTEGER, 24, 0, 0)

GRAY25 class-attribute instance-attribute

GRAY25 = _make_video_id(GRAY, INTEGER, 25, 0, 0)

GRAY26 class-attribute instance-attribute

GRAY26 = _make_video_id(GRAY, INTEGER, 26, 0, 0)

GRAY27 class-attribute instance-attribute

GRAY27 = _make_video_id(GRAY, INTEGER, 27, 0, 0)

GRAY28 class-attribute instance-attribute

GRAY28 = _make_video_id(GRAY, INTEGER, 28, 0, 0)

GRAY29 class-attribute instance-attribute

GRAY29 = _make_video_id(GRAY, INTEGER, 29, 0, 0)

GRAY30 class-attribute instance-attribute

GRAY30 = _make_video_id(GRAY, INTEGER, 30, 0, 0)

GRAY31 class-attribute instance-attribute

GRAY31 = _make_video_id(GRAY, INTEGER, 31, 0, 0)

GRAY32 class-attribute instance-attribute

GRAY32 = VSPresetVideoFormat.GRAY32

GRAY8 class-attribute instance-attribute

GRAY8 = VSPresetVideoFormat.GRAY8

GRAY9 class-attribute instance-attribute

GRAY9 = VSPresetVideoFormat.GRAY9

GRAYH class-attribute instance-attribute

GRAYH = VSPresetVideoFormat.GRAYH

GRAYS class-attribute instance-attribute

GRAYS = VSPresetVideoFormat.GRAYS

NONE class-attribute instance-attribute

NONE = VSPresetVideoFormat.NONE

RGB24 class-attribute instance-attribute

RGB24 = VSPresetVideoFormat.RGB24

RGB27 class-attribute instance-attribute

RGB27 = VSPresetVideoFormat.RGB27

RGB30 class-attribute instance-attribute

RGB30 = VSPresetVideoFormat.RGB30

RGB33 class-attribute instance-attribute

RGB33 = _make_video_id(RGB, INTEGER, 11, 0, 0)

RGB36 class-attribute instance-attribute

RGB36 = VSPresetVideoFormat.RGB36

RGB39 class-attribute instance-attribute

RGB39 = _make_video_id(RGB, INTEGER, 13, 0, 0)

RGB42 class-attribute instance-attribute

RGB42 = VSPresetVideoFormat.RGB42

RGB45 class-attribute instance-attribute

RGB45 = _make_video_id(RGB, INTEGER, 15, 0, 0)

RGB48 class-attribute instance-attribute

RGB48 = VSPresetVideoFormat.RGB48

RGB51 class-attribute instance-attribute

RGB51 = _make_video_id(RGB, INTEGER, 17, 0, 0)

RGB54 class-attribute instance-attribute

RGB54 = _make_video_id(RGB, INTEGER, 18, 0, 0)

RGB57 class-attribute instance-attribute

RGB57 = _make_video_id(RGB, INTEGER, 19, 0, 0)

RGB60 class-attribute instance-attribute

RGB60 = _make_video_id(RGB, INTEGER, 20, 0, 0)

RGB63 class-attribute instance-attribute

RGB63 = _make_video_id(RGB, INTEGER, 21, 0, 0)

RGB66 class-attribute instance-attribute

RGB66 = _make_video_id(RGB, INTEGER, 22, 0, 0)

RGB69 class-attribute instance-attribute

RGB69 = _make_video_id(RGB, INTEGER, 23, 0, 0)

RGB72 class-attribute instance-attribute

RGB72 = _make_video_id(RGB, INTEGER, 24, 0, 0)

RGB75 class-attribute instance-attribute

RGB75 = _make_video_id(RGB, INTEGER, 25, 0, 0)

RGB78 class-attribute instance-attribute

RGB78 = _make_video_id(RGB, INTEGER, 26, 0, 0)

RGB81 class-attribute instance-attribute

RGB81 = _make_video_id(RGB, INTEGER, 27, 0, 0)

RGB84 class-attribute instance-attribute

RGB84 = _make_video_id(RGB, INTEGER, 28, 0, 0)

RGB87 class-attribute instance-attribute

RGB87 = _make_video_id(RGB, INTEGER, 29, 0, 0)

RGB90 class-attribute instance-attribute

RGB90 = _make_video_id(RGB, INTEGER, 30, 0, 0)

RGB93 class-attribute instance-attribute

RGB93 = _make_video_id(RGB, INTEGER, 31, 0, 0)

RGB96 class-attribute instance-attribute

RGB96 = _make_video_id(RGB, INTEGER, 32, 0, 0)

RGBH class-attribute instance-attribute

RGBH = VSPresetVideoFormat.RGBH

RGBS class-attribute instance-attribute

RGBS = VSPresetVideoFormat.RGBS

YUV410P10 class-attribute instance-attribute

YUV410P10 = _make_video_id(YUV, INTEGER, 10, 2, 2)

YUV410P11 class-attribute instance-attribute

YUV410P11 = _make_video_id(YUV, INTEGER, 11, 2, 2)

YUV410P12 class-attribute instance-attribute

YUV410P12 = _make_video_id(YUV, INTEGER, 12, 2, 2)

YUV410P13 class-attribute instance-attribute

YUV410P13 = _make_video_id(YUV, INTEGER, 13, 2, 2)

YUV410P14 class-attribute instance-attribute

YUV410P14 = _make_video_id(YUV, INTEGER, 14, 2, 2)

YUV410P15 class-attribute instance-attribute

YUV410P15 = _make_video_id(YUV, INTEGER, 15, 2, 2)

YUV410P16 class-attribute instance-attribute

YUV410P16 = _make_video_id(YUV, INTEGER, 16, 2, 2)

YUV410P17 class-attribute instance-attribute

YUV410P17 = _make_video_id(YUV, INTEGER, 17, 2, 2)

YUV410P18 class-attribute instance-attribute

YUV410P18 = _make_video_id(YUV, INTEGER, 18, 2, 2)

YUV410P19 class-attribute instance-attribute

YUV410P19 = _make_video_id(YUV, INTEGER, 19, 2, 2)

YUV410P20 class-attribute instance-attribute

YUV410P20 = _make_video_id(YUV, INTEGER, 20, 2, 2)

YUV410P21 class-attribute instance-attribute

YUV410P21 = _make_video_id(YUV, INTEGER, 21, 2, 2)

YUV410P22 class-attribute instance-attribute

YUV410P22 = _make_video_id(YUV, INTEGER, 22, 2, 2)

YUV410P23 class-attribute instance-attribute

YUV410P23 = _make_video_id(YUV, INTEGER, 23, 2, 2)

YUV410P24 class-attribute instance-attribute

YUV410P24 = _make_video_id(YUV, INTEGER, 24, 2, 2)

YUV410P25 class-attribute instance-attribute

YUV410P25 = _make_video_id(YUV, INTEGER, 25, 2, 2)

YUV410P26 class-attribute instance-attribute

YUV410P26 = _make_video_id(YUV, INTEGER, 26, 2, 2)

YUV410P27 class-attribute instance-attribute

YUV410P27 = _make_video_id(YUV, INTEGER, 27, 2, 2)

YUV410P28 class-attribute instance-attribute

YUV410P28 = _make_video_id(YUV, INTEGER, 28, 2, 2)

YUV410P29 class-attribute instance-attribute

YUV410P29 = _make_video_id(YUV, INTEGER, 29, 2, 2)

YUV410P30 class-attribute instance-attribute

YUV410P30 = _make_video_id(YUV, INTEGER, 30, 2, 2)

YUV410P31 class-attribute instance-attribute

YUV410P31 = _make_video_id(YUV, INTEGER, 31, 2, 2)

YUV410P32 class-attribute instance-attribute

YUV410P32 = _make_video_id(YUV, INTEGER, 32, 2, 2)

YUV410P8 class-attribute instance-attribute

YUV410P8 = VSPresetVideoFormat.YUV410P8

YUV410P9 class-attribute instance-attribute

YUV410P9 = _make_video_id(YUV, INTEGER, 9, 2, 2)

YUV410PH class-attribute instance-attribute

YUV410PH = _make_video_id(YUV, FLOAT, 16, 2, 2)

YUV410PS class-attribute instance-attribute

YUV410PS = _make_video_id(YUV, FLOAT, 32, 2, 2)

YUV411P10 class-attribute instance-attribute

YUV411P10 = _make_video_id(YUV, INTEGER, 10, 2, 0)

YUV411P11 class-attribute instance-attribute

YUV411P11 = _make_video_id(YUV, INTEGER, 11, 2, 0)

YUV411P12 class-attribute instance-attribute

YUV411P12 = _make_video_id(YUV, INTEGER, 12, 2, 0)

YUV411P13 class-attribute instance-attribute

YUV411P13 = _make_video_id(YUV, INTEGER, 13, 2, 0)

YUV411P14 class-attribute instance-attribute

YUV411P14 = _make_video_id(YUV, INTEGER, 14, 2, 0)

YUV411P15 class-attribute instance-attribute

YUV411P15 = _make_video_id(YUV, INTEGER, 15, 2, 0)

YUV411P16 class-attribute instance-attribute

YUV411P16 = _make_video_id(YUV, INTEGER, 16, 2, 0)

YUV411P17 class-attribute instance-attribute

YUV411P17 = _make_video_id(YUV, INTEGER, 17, 2, 0)

YUV411P18 class-attribute instance-attribute

YUV411P18 = _make_video_id(YUV, INTEGER, 18, 2, 0)

YUV411P19 class-attribute instance-attribute

YUV411P19 = _make_video_id(YUV, INTEGER, 19, 2, 0)

YUV411P20 class-attribute instance-attribute

YUV411P20 = _make_video_id(YUV, INTEGER, 20, 2, 0)

YUV411P21 class-attribute instance-attribute

YUV411P21 = _make_video_id(YUV, INTEGER, 21, 2, 0)

YUV411P22 class-attribute instance-attribute

YUV411P22 = _make_video_id(YUV, INTEGER, 22, 2, 0)

YUV411P23 class-attribute instance-attribute

YUV411P23 = _make_video_id(YUV, INTEGER, 23, 2, 0)

YUV411P24 class-attribute instance-attribute

YUV411P24 = _make_video_id(YUV, INTEGER, 24, 2, 0)

YUV411P25 class-attribute instance-attribute

YUV411P25 = _make_video_id(YUV, INTEGER, 25, 2, 0)

YUV411P26 class-attribute instance-attribute

YUV411P26 = _make_video_id(YUV, INTEGER, 26, 2, 0)

YUV411P27 class-attribute instance-attribute

YUV411P27 = _make_video_id(YUV, INTEGER, 27, 2, 0)

YUV411P28 class-attribute instance-attribute

YUV411P28 = _make_video_id(YUV, INTEGER, 28, 2, 0)

YUV411P29 class-attribute instance-attribute

YUV411P29 = _make_video_id(YUV, INTEGER, 29, 2, 0)

YUV411P30 class-attribute instance-attribute

YUV411P30 = _make_video_id(YUV, INTEGER, 30, 2, 0)

YUV411P31 class-attribute instance-attribute

YUV411P31 = _make_video_id(YUV, INTEGER, 31, 2, 0)

YUV411P32 class-attribute instance-attribute

YUV411P32 = _make_video_id(YUV, INTEGER, 32, 2, 0)

YUV411P8 class-attribute instance-attribute

YUV411P8 = VSPresetVideoFormat.YUV411P8

YUV411P9 class-attribute instance-attribute

YUV411P9 = _make_video_id(YUV, INTEGER, 9, 2, 0)

YUV411PH class-attribute instance-attribute

YUV411PH = _make_video_id(YUV, FLOAT, 16, 2, 0)

YUV411PS class-attribute instance-attribute

YUV411PS = _make_video_id(YUV, FLOAT, 32, 2, 0)

YUV420P10 class-attribute instance-attribute

YUV420P10 = VSPresetVideoFormat.YUV420P10

YUV420P11 class-attribute instance-attribute

YUV420P11 = _make_video_id(YUV, INTEGER, 11, 1, 1)

YUV420P12 class-attribute instance-attribute

YUV420P12 = VSPresetVideoFormat.YUV420P12

YUV420P13 class-attribute instance-attribute

YUV420P13 = _make_video_id(YUV, INTEGER, 13, 1, 1)

YUV420P14 class-attribute instance-attribute

YUV420P14 = VSPresetVideoFormat.YUV420P14

YUV420P15 class-attribute instance-attribute

YUV420P15 = _make_video_id(YUV, INTEGER, 15, 1, 1)

YUV420P16 class-attribute instance-attribute

YUV420P16 = VSPresetVideoFormat.YUV420P16

YUV420P17 class-attribute instance-attribute

YUV420P17 = _make_video_id(YUV, INTEGER, 17, 1, 1)

YUV420P18 class-attribute instance-attribute

YUV420P18 = _make_video_id(YUV, INTEGER, 18, 1, 1)

YUV420P19 class-attribute instance-attribute

YUV420P19 = _make_video_id(YUV, INTEGER, 19, 1, 1)

YUV420P20 class-attribute instance-attribute

YUV420P20 = _make_video_id(YUV, INTEGER, 20, 1, 1)

YUV420P21 class-attribute instance-attribute

YUV420P21 = _make_video_id(YUV, INTEGER, 21, 1, 1)

YUV420P22 class-attribute instance-attribute

YUV420P22 = _make_video_id(YUV, INTEGER, 22, 1, 1)

YUV420P23 class-attribute instance-attribute

YUV420P23 = _make_video_id(YUV, INTEGER, 23, 1, 1)

YUV420P24 class-attribute instance-attribute

YUV420P24 = _make_video_id(YUV, INTEGER, 24, 1, 1)

YUV420P25 class-attribute instance-attribute

YUV420P25 = _make_video_id(YUV, INTEGER, 25, 1, 1)

YUV420P26 class-attribute instance-attribute

YUV420P26 = _make_video_id(YUV, INTEGER, 26, 1, 1)

YUV420P27 class-attribute instance-attribute

YUV420P27 = _make_video_id(YUV, INTEGER, 27, 1, 1)

YUV420P28 class-attribute instance-attribute

YUV420P28 = _make_video_id(YUV, INTEGER, 28, 1, 1)

YUV420P29 class-attribute instance-attribute

YUV420P29 = _make_video_id(YUV, INTEGER, 29, 1, 1)

YUV420P30 class-attribute instance-attribute

YUV420P30 = _make_video_id(YUV, INTEGER, 30, 1, 1)

YUV420P31 class-attribute instance-attribute

YUV420P31 = _make_video_id(YUV, INTEGER, 31, 1, 1)

YUV420P32 class-attribute instance-attribute

YUV420P32 = _make_video_id(YUV, INTEGER, 32, 1, 1)

YUV420P8 class-attribute instance-attribute

YUV420P8 = VSPresetVideoFormat.YUV420P8

YUV420P9 class-attribute instance-attribute

YUV420P9 = VSPresetVideoFormat.YUV420P9

YUV420PH class-attribute instance-attribute

YUV420PH = VSPresetVideoFormat.YUV420PH

YUV420PS class-attribute instance-attribute

YUV420PS = VSPresetVideoFormat.YUV420PS

YUV422P10 class-attribute instance-attribute

YUV422P10 = VSPresetVideoFormat.YUV422P10

YUV422P11 class-attribute instance-attribute

YUV422P11 = _make_video_id(YUV, INTEGER, 11, 1, 0)

YUV422P12 class-attribute instance-attribute

YUV422P12 = VSPresetVideoFormat.YUV422P12

YUV422P13 class-attribute instance-attribute

YUV422P13 = _make_video_id(YUV, INTEGER, 13, 1, 0)

YUV422P14 class-attribute instance-attribute

YUV422P14 = VSPresetVideoFormat.YUV422P14

YUV422P15 class-attribute instance-attribute

YUV422P15 = _make_video_id(YUV, INTEGER, 15, 1, 0)

YUV422P16 class-attribute instance-attribute

YUV422P16 = VSPresetVideoFormat.YUV422P16

YUV422P17 class-attribute instance-attribute

YUV422P17 = _make_video_id(YUV, INTEGER, 17, 1, 0)

YUV422P18 class-attribute instance-attribute

YUV422P18 = _make_video_id(YUV, INTEGER, 18, 1, 0)

YUV422P19 class-attribute instance-attribute

YUV422P19 = _make_video_id(YUV, INTEGER, 19, 1, 0)

YUV422P20 class-attribute instance-attribute

YUV422P20 = _make_video_id(YUV, INTEGER, 20, 1, 0)

YUV422P21 class-attribute instance-attribute

YUV422P21 = _make_video_id(YUV, INTEGER, 21, 1, 0)

YUV422P22 class-attribute instance-attribute

YUV422P22 = _make_video_id(YUV, INTEGER, 22, 1, 0)

YUV422P23 class-attribute instance-attribute

YUV422P23 = _make_video_id(YUV, INTEGER, 23, 1, 0)

YUV422P24 class-attribute instance-attribute

YUV422P24 = _make_video_id(YUV, INTEGER, 24, 1, 0)

YUV422P25 class-attribute instance-attribute

YUV422P25 = _make_video_id(YUV, INTEGER, 25, 1, 0)

YUV422P26 class-attribute instance-attribute

YUV422P26 = _make_video_id(YUV, INTEGER, 26, 1, 0)

YUV422P27 class-attribute instance-attribute

YUV422P27 = _make_video_id(YUV, INTEGER, 27, 1, 0)

YUV422P28 class-attribute instance-attribute

YUV422P28 = _make_video_id(YUV, INTEGER, 28, 1, 0)

YUV422P29 class-attribute instance-attribute

YUV422P29 = _make_video_id(YUV, INTEGER, 29, 1, 0)

YUV422P30 class-attribute instance-attribute

YUV422P30 = _make_video_id(YUV, INTEGER, 30, 1, 0)

YUV422P31 class-attribute instance-attribute

YUV422P31 = _make_video_id(YUV, INTEGER, 31, 1, 0)

YUV422P32 class-attribute instance-attribute

YUV422P32 = _make_video_id(YUV, INTEGER, 32, 1, 0)

YUV422P8 class-attribute instance-attribute

YUV422P8 = VSPresetVideoFormat.YUV422P8

YUV422P9 class-attribute instance-attribute

YUV422P9 = VSPresetVideoFormat.YUV422P9

YUV422PH class-attribute instance-attribute

YUV422PH = VSPresetVideoFormat.YUV422PH

YUV422PS class-attribute instance-attribute

YUV422PS = VSPresetVideoFormat.YUV422PS

YUV440P10 class-attribute instance-attribute

YUV440P10 = _make_video_id(YUV, INTEGER, 10, 0, 1)

YUV440P11 class-attribute instance-attribute

YUV440P11 = _make_video_id(YUV, INTEGER, 11, 0, 1)

YUV440P12 class-attribute instance-attribute

YUV440P12 = _make_video_id(YUV, INTEGER, 12, 0, 1)

YUV440P13 class-attribute instance-attribute

YUV440P13 = _make_video_id(YUV, INTEGER, 13, 0, 1)

YUV440P14 class-attribute instance-attribute

YUV440P14 = _make_video_id(YUV, INTEGER, 14, 0, 1)

YUV440P15 class-attribute instance-attribute

YUV440P15 = _make_video_id(YUV, INTEGER, 15, 0, 1)

YUV440P16 class-attribute instance-attribute

YUV440P16 = _make_video_id(YUV, INTEGER, 16, 0, 1)

YUV440P17 class-attribute instance-attribute

YUV440P17 = _make_video_id(YUV, INTEGER, 17, 0, 1)

YUV440P18 class-attribute instance-attribute

YUV440P18 = _make_video_id(YUV, INTEGER, 18, 0, 1)

YUV440P19 class-attribute instance-attribute

YUV440P19 = _make_video_id(YUV, INTEGER, 19, 0, 1)

YUV440P20 class-attribute instance-attribute

YUV440P20 = _make_video_id(YUV, INTEGER, 20, 0, 1)

YUV440P21 class-attribute instance-attribute

YUV440P21 = _make_video_id(YUV, INTEGER, 21, 0, 1)

YUV440P22 class-attribute instance-attribute

YUV440P22 = _make_video_id(YUV, INTEGER, 22, 0, 1)

YUV440P23 class-attribute instance-attribute

YUV440P23 = _make_video_id(YUV, INTEGER, 23, 0, 1)

YUV440P24 class-attribute instance-attribute

YUV440P24 = _make_video_id(YUV, INTEGER, 24, 0, 1)

YUV440P25 class-attribute instance-attribute

YUV440P25 = _make_video_id(YUV, INTEGER, 25, 0, 1)

YUV440P26 class-attribute instance-attribute

YUV440P26 = _make_video_id(YUV, INTEGER, 26, 0, 1)

YUV440P27 class-attribute instance-attribute

YUV440P27 = _make_video_id(YUV, INTEGER, 27, 0, 1)

YUV440P28 class-attribute instance-attribute

YUV440P28 = _make_video_id(YUV, INTEGER, 28, 0, 1)

YUV440P29 class-attribute instance-attribute

YUV440P29 = _make_video_id(YUV, INTEGER, 29, 0, 1)

YUV440P30 class-attribute instance-attribute

YUV440P30 = _make_video_id(YUV, INTEGER, 30, 0, 1)

YUV440P31 class-attribute instance-attribute

YUV440P31 = _make_video_id(YUV, INTEGER, 31, 0, 1)

YUV440P32 class-attribute instance-attribute

YUV440P32 = _make_video_id(YUV, INTEGER, 32, 0, 1)

YUV440P8 class-attribute instance-attribute

YUV440P8 = VSPresetVideoFormat.YUV440P8

YUV440P9 class-attribute instance-attribute

YUV440P9 = _make_video_id(YUV, INTEGER, 9, 0, 1)

YUV440PH class-attribute instance-attribute

YUV440PH = _make_video_id(YUV, FLOAT, 16, 0, 1)

YUV440PS class-attribute instance-attribute

YUV440PS = _make_video_id(YUV, FLOAT, 32, 0, 1)

YUV444P10 class-attribute instance-attribute

YUV444P10 = VSPresetVideoFormat.YUV444P10

YUV444P11 class-attribute instance-attribute

YUV444P11 = _make_video_id(YUV, INTEGER, 11, 0, 0)

YUV444P12 class-attribute instance-attribute

YUV444P12 = VSPresetVideoFormat.YUV444P12

YUV444P13 class-attribute instance-attribute

YUV444P13 = _make_video_id(YUV, INTEGER, 13, 0, 0)

YUV444P14 class-attribute instance-attribute

YUV444P14 = VSPresetVideoFormat.YUV444P14

YUV444P15 class-attribute instance-attribute

YUV444P15 = _make_video_id(YUV, INTEGER, 15, 0, 0)

YUV444P16 class-attribute instance-attribute

YUV444P16 = VSPresetVideoFormat.YUV444P16

YUV444P17 class-attribute instance-attribute

YUV444P17 = _make_video_id(YUV, INTEGER, 17, 0, 0)

YUV444P18 class-attribute instance-attribute

YUV444P18 = _make_video_id(YUV, INTEGER, 18, 0, 0)

YUV444P19 class-attribute instance-attribute

YUV444P19 = _make_video_id(YUV, INTEGER, 19, 0, 0)

YUV444P20 class-attribute instance-attribute

YUV444P20 = _make_video_id(YUV, INTEGER, 20, 0, 0)

YUV444P21 class-attribute instance-attribute

YUV444P21 = _make_video_id(YUV, INTEGER, 21, 0, 0)

YUV444P22 class-attribute instance-attribute

YUV444P22 = _make_video_id(YUV, INTEGER, 22, 0, 0)

YUV444P23 class-attribute instance-attribute

YUV444P23 = _make_video_id(YUV, INTEGER, 23, 0, 0)

YUV444P24 class-attribute instance-attribute

YUV444P24 = _make_video_id(YUV, INTEGER, 24, 0, 0)

YUV444P25 class-attribute instance-attribute

YUV444P25 = _make_video_id(YUV, INTEGER, 25, 0, 0)

YUV444P26 class-attribute instance-attribute

YUV444P26 = _make_video_id(YUV, INTEGER, 26, 0, 0)

YUV444P27 class-attribute instance-attribute

YUV444P27 = _make_video_id(YUV, INTEGER, 27, 0, 0)

YUV444P28 class-attribute instance-attribute

YUV444P28 = _make_video_id(YUV, INTEGER, 28, 0, 0)

YUV444P29 class-attribute instance-attribute

YUV444P29 = _make_video_id(YUV, INTEGER, 29, 0, 0)

YUV444P30 class-attribute instance-attribute

YUV444P30 = _make_video_id(YUV, INTEGER, 30, 0, 0)

YUV444P31 class-attribute instance-attribute

YUV444P31 = _make_video_id(YUV, INTEGER, 31, 0, 0)

YUV444P32 class-attribute instance-attribute

YUV444P32 = _make_video_id(YUV, INTEGER, 32, 0, 0)

YUV444P8 class-attribute instance-attribute

YUV444P8 = VSPresetVideoFormat.YUV444P8

YUV444P9 class-attribute instance-attribute

YUV444P9 = VSPresetVideoFormat.YUV444P9

YUV444PH class-attribute instance-attribute

YUV444PH = VSPresetVideoFormat.YUV444PH

YUV444PS class-attribute instance-attribute

YUV444PS = VSPresetVideoFormat.YUV444PS

VSCoreProxy

VSCoreProxy(core: Core | None = None)

Bases: _CoreProxyBase

Class for wrapping a VapourSynth core.

Methods:

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 CoreProxy with no initial Core reference.

  • proxied (CoreProxy) –

    A CoreProxy backed by a weak reference to the current Core.

Source code in vstools/vs_proxy/proxy.py
1110
1111
1112
def __init__(self, core: Core | None = None) -> None:
    object.__setattr__(self, "_own_core", core is not None)
    object.__setattr__(self, "_core_ref", core and weakref.ref(core))

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 property

core: Core

The underlying VapourSynth Core instance.

core_id property

core_id: int

The unique integer identifier of the active VapourSynth Core.

Raises:

env property

The EnvironmentProxy singleton representing the current environment execution context.

Raises:

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
@deprecated("This function is deprecated. Use `vs.register_on_destroy()` instead.", category=DeprecationWarning)
def register_on_destroy(self, callback: Callable[[], None]) -> None:
    register_on_destroy(callback)

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 cores 0 through threads - 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 to range(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:

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
def set_affinity(
    self,
    threads: int | float | range | tuple[int, int] | list[int] | None = None,  # noqa: PYI041
    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.

    Args:
        threads: Defines how many and which CPU cores to use.

            Accepted formats:

               - ``None``: Use all available CPU cores.
               - ``int``: Use cores ``0`` through ``threads - 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 to ``range(start, stop)``.
               - ``list[int]``: Explicit list of core indices.

        max_cache: Maximum VapourSynth frame buffer cache size, in megabytes.
            If ``None``, the default setting is preserved.

    Raises:
        CustomValueError: If ``threads`` is lower than or equal to 0.
    """
    import math
    import multiprocessing

    import psutil

    if threads is None:
        threads = multiprocessing.cpu_count()

    if isinstance(threads, float):
        if threads <= 0:
            raise CustomValueError(
                "When passing a float, `threads` should be greater than 0.", self.set_affinity, threads
            )

        threads = math.ceil(multiprocessing.cpu_count() * threads)

    if isinstance(threads, int):
        threads = range(0, threads)
    elif isinstance(threads, tuple):
        threads = range(*threads)

    threads = list(set(threads) - set(reserve or []))

    self.core.num_threads = len(threads)

    psutil.Process().cpu_affinity(threads)

    if max_cache is not None:
        self.core.max_cache_size = max_cache

unregister_on_destroy

unregister_on_destroy(callback: Callable[[], None]) -> None
Source code in vstools/vs_proxy/proxy.py
1207
1208
1209
@deprecated("This function is deprecated. Use `vs.unregister_on_destroy()` instead.", category=DeprecationWarning)
def unregister_on_destroy(self, callback: Callable[[], None]) -> None:
    unregister_on_destroy(callback)

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
@deprecated("This function is deprecated. Use `core.clear_cache()` instead.", category=DeprecationWarning)
def clear_cache() -> None:
    try:
        cache_size = int(core.max_cache_size)
        core.max_cache_size = 1
        try:
            for output in get_outputs().values():
                if isinstance(output, VideoOutputTuple):
                    output.clip.get_frame(0).close()
                    break
        except Exception:
            core.std.BlankClip().get_frame(0).close()
        core.max_cache_size = cache_size
    except Exception:
        ...

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
def get_policy() -> EnvironmentPolicy | VSScriptEnvironmentPolicy | StandaloneEnvironmentPolicy:
    """Retrieve the currently active VapourSynth EnvironmentPolicy."""
    if (data := get_current_environment().env()) is None:
        raise CustomRuntimeError("No environment is currently activated.")

    policy = _find_ref(data, (EnvironmentPolicy, VSScriptEnvironmentPolicy, StandaloneEnvironmentPolicy))

    if policy is None:
        raise CustomRuntimeError("No policy is currently registered.")

    return policy  # type: ignore[return-value]

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
def get_policy_api() -> EnvironmentPolicyAPI:
    """Retrieve the VapourSynth EnvironmentPolicyAPI bound to the currently registered policy."""
    api = _find_ref(get_policy(), (EnvironmentPolicyAPI,))

    if api is None:
        raise CustomRuntimeError("No policy API is currently registered.")

    return api

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
def has_environment() -> bool:
    """Check if the current thread is running inside an environment."""
    try:
        return not not get_current_environment()  # noqa: SIM208
    except RuntimeError:
        return False

register_on_creation

register_on_creation(callback: Callable[[int], None]) -> bool

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
def register_on_creation(callback: Callable[[int], None]) -> bool:
    """
    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.
    """
    with _core_on_creation_callbacks_lock:
        _core_on_creation_callbacks.add(callback)

        # If a core is already active, the catch-up logic is triggered immediately.
        # We trigger '_core_with_cb', which will execute any registered callbacks
        # that haven't been run for the current core instance yet.
        if has_policy() and has_environment() and core.active:
            with get_current_environment().use():
                core._core_with_cb
            return True

        return False

unregister_on_creation

unregister_on_creation(callback: Callable[[int], None]) -> bool

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
def unregister_on_creation(callback: Callable[[int], None]) -> bool:
    """
    Unregister this callback from every core creation.

    Returns whether the callback was successfully unregistered.
    """
    with _core_on_creation_callbacks_lock:
        try:
            _core_on_creation_callbacks.remove(callback)
            return True
        except KeyError:
            return False