Skip to content

objects

Classes:

  • VSDebug

    Special class that follows the VapourSynth lifecycle for debug purposes.

  • VSObject

    Base class for objects bound to the lifecycle of a VapourSynth core.

  • VSObjectABC

    Abstract base class for VSObject subclasses.

  • VSObjectABCMeta

    Metaclass for abstract VSObject classes.

  • VSObjectMeta

    Metaclass for VSObject that ensures VapourSynth object lifecycle hooks are registered.

Attributes:

  • vs_object

    Deprecated alias for VSObject

vs_object module-attribute

vs_object = VSObject

Deprecated alias for VSObject

VSDebug

VSDebug(
    *,
    env_life: bool = True,
    core_fetch: bool = False,
    use_logging: bool = False
)

Bases: Singleton

Special class that follows the VapourSynth lifecycle for debug purposes.

Print useful debug information.

Parameters:

  • env_life

    (bool, default: True ) –

    Print creation/destroy of VapourSynth environment.

  • core_fetch

    (bool, default: False ) –

    Print traceback of the code that led to the first concrete core fetch. Especially useful when trying to find the code path that is locking you into a EnvironmentPolicy.

Source code in vstools/vs_proxy/objects.py
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
def __init__(self, *, env_life: bool = True, core_fetch: bool = False, use_logging: bool = False) -> None:
    """
    Print useful debug information.

    Args:
        env_life: Print creation/destroy of VapourSynth environment.
        core_fetch: Print traceback of the code that led to the first concrete core fetch. Especially useful when
            trying to find the code path that is locking you into a EnvironmentPolicy.
    """
    if use_logging:
        import logging

        VSDebug._print_func = logging.debug
    else:
        VSDebug._print_func = print

    if env_life:
        register_on_creation(VSDebug._print_env_live, True)

    if core_fetch:
        register_on_creation(VSDebug._print_stack, True)

VSObject

Base class for objects bound to the lifecycle of a VapourSynth core.

Subclasses can define the special dunder method __vs_del__, which is invoked when the VapourSynth core that owns the object is released.

By default, this method will attempt to safely delete any references to VapourSynth objects held by the instance. Overriding __vs_del__ is only necessary if you need custom cleanup logic beyond the default safe release.

VSObjectABC

Bases: VSObject, ABC

Abstract base class for VSObject subclasses.

VSObjectABCMeta

Bases: VSObjectMeta, ABCMeta

Metaclass for abstract VSObject classes.

VSObjectMeta

Bases: type

Metaclass for VSObject that ensures VapourSynth object lifecycle hooks are registered.

This metaclass automatically registers the __vs_del__ cleanup hook for any class that inherits from VSObject. By default, the cleanup mechanism will attempt to safely release any VapourSynth-bound objects when the core is freed, preventing resource leaks.