Skip to content

Clip

class vidiopy.Clip.Clip

Bases: object

A Clip is the base class for all the clips (VideoClip and AudioClip).

fx(func, *args, **kwargs)

Apply a function to the current instance and return the result.

This method allows for the application of any callable to the current instance of the class. The callable should take the instance as its first argument, followed by any number of positional and keyword arguments.

Parameters:
  • func: (Callable[..., Self]): The function to apply. This should take the instance as its first argument.
  • *args: Variable length argument list for the function.
  • **kwargs: Arbitrary keyword arguments for the function.
Returns:
  • Self: The result of applying the function to the instance.
Example:
>>> clip = Clip()
>>> def do(instance):
...     # Do something with instance.
...     return instance.
...
>>> new_clip = clip.fx(do)

copy()

Creates a deep copy of the current Clip object.

This method creates a new instance of the Clip object, copying all the attributes of the current object into the new one. If the current object has an 'audio' attribute, it also creates a deep copy of this 'audio' object and assigns it to the 'audio' attribute of the new Clip object.

Returns:
Clip: A new Clip object that is a deep copy of the current object.

close()

Release any resources that are in use.

__enter__()

Enter the context manager.

__exit__()

Exit the context manager.

Comments