editors
Contains functions used to edit a VideoFileClip or np.ndarray prior to extraction.
trim_clip
Trim a VideoFileClip to a specific time range and return the trimmed clip.
Args:
`clip` (moviepy.editor.VideoFileClip):
The clip to trim.
`start_second` (float | None):
The start time in seconds. If None, the trim will start at the beginning.
`stop_second` (float | None):
The stop time in seconds. If None, the clip will be trimmed to the end.
Returns:
`moviepy.editor.VideoFileClip`: The trimmed clip.
Source code in videoxt/editors.py
edit_clip_audio
Edit the audio of a VideoFileClip by adjusting its volume and normalizing the audio if specified and return the edited clip.
Args:
`clip` (moviepy.editor.VideoFileClip):
The clip to edit.
`volume` (float | None):
The volume multiplier. If None, the volume will not be adjusted.
`normalize` (bool | None):
Whether to normalize the audio. If None, the audio will not be normalized.
Returns:
`moviepy.editor.VideoFileClip`: The edited clip.
Source code in videoxt/editors.py
edit_clip_image
Edit the image properties of a VideoFileClip by resizing, rotating, and converting to monochrome if specified and return the edited clip.
Args:
`clip` (moviepy.editor.VideoFileClip):
The clip to edit.
`dimensions` (tuple[int, int] | None):
The dimensions to resize the clip to. If None, the clip will not be resized.
`rotate` (int | None):
The degrees to rotate the clip. If None, the clip will not be rotated.
`monochrome` (bool | None):
Whether to convert the clip to monochrome. If None, the black and white
filter will not be applied.
Returns:
`moviepy.editor.VideoFileClip`: The edited clip.
Source code in videoxt/editors.py
edit_clip_motion
Edit the moving image properties of a VideoFileClip by adjusting its speed, reversing, and bouncing if specified and return the edited clip.
Args:
`clip` (moviepy.editor.VideoFileClip):
The clip to edit.
`speed` (float | None):
The speed multiplier. If None, the speed will not be adjusted.
`reverse` (bool | None):
Whether to reverse the clip. If None, the clip will not be reversed.
`bounce` (bool | None):
Whether to bounce the clip. If None, the clip will not be bounced.
Returns:
`moviepy.editor.VideoFileClip`: The edited clip.
Source code in videoxt/editors.py
edit_image
Edit a numpy.ndarray image by resizing, rotating, and converting to monochrome if specified and return the edited image.
Args:
`image` (np.ndarray[Any, Any]):
The image to edit.
`dimensions` (tuple[int, int] | None):
The dimensions to resize the image to. If None, the image will not be
resized.
`rotate` (int | None):
The degrees to rotate the image. If None, the image will not be rotated.
`monochrome` (bool | None):
Whether to convert the image to monochrome. If None, the black and white
filter will not be applied.
Returns:
`np.ndarray[Any, Any]`: The edited image.