extractors
This module contains extractor objects that perform extractions.
Extractor
Bases: Protocol
Protocol defining the interface for performing any extraction operation.
extract
Perform extraction and return the path to the extracted file or directory.
Returns:
`Path`: The path to the extracted file or directory.
AudioExtractor
dataclass
Instantiate me with a PreparedAudioRequest and I'll provide you with an
extract() method that will extract audio from the video file in the request,
apply requested edits to the audio, and save it to disk.
Fields:
`request` (PreparedAudioRequest):
Request parameters the extractor will use to perform the extraction.
Public Methods:
`extract()` -> `Path`:
Execute audio extraction and return the path to the extracted audio
file.
extract
Extract audio from a video within a given time range and return the path to the saved audio file. Optional edits to audio are applied before saving to disk.
Returns:
`Path | None`:
The path to the extracted audio file if the write was successful.
Source code in videoxt/extractors.py
ClipExtractor
dataclass
Instantiate me with a PreparedClipRequest and I'll provide you with an extract()
method that will extract a subclip from the video file in the request, apply
requested edits to the subclip, and save it to disk.
Fields:
`request` (PreparedClipRequest):
Request parameters the extractor will use to perform the extraction.
Public Methods:
`extract()` -> `Path`:
Execute subclip extraction and return the path to the extracted clip.
extract
Extract a subclip from a video within a given time range and return the file path to clip. Optional edits to the clip are applied before saving to disk.
Returns:
`Path`:
The path to the extracted clip if the write was successful.
Source code in videoxt/extractors.py
FramesExtractor
dataclass
Instantiate me with a PreparedFramesRequest and I'll provide you with an
extract() method that will extract frames from the video file in the request,
apply requested edits to the frames, and save them to disk as images in a directory.
Fields:
`request` (PreparedFramesRequest):
The request to prepare and perform an extraction operation with.
Public Methods:
`extract()` -> `Path`:
Execute frames extraction and return the path to the directory where the
extracted images were saved.
extract
Extract frames from a video, save them to disk as images, and return the path to the directory where the images were saved.
Returns:
`Path`: The directory where the extracted images were saved.
Source code in videoxt/extractors.py
GifExtractor
dataclass
Instantiate me with a PreparedGifRequest and I'll provide you with an extract()
method that will extract a gif from the video file in the request, apply requested
edits to the gif, and save it to disk.
Attributes:
`request` (PreparedGifRequest):
Request parameters the extractor will use to perform the extraction.
Public Methods:
`extract()` -> `Path`:
Execute gif extraction and return the path to the extracted gif.
extract
Extract a gif from a video within a given time range and return the file path the gif. Optional edits to the gif are applied before saving to disk.
Returns:
`Path`:
The path to the extracted gif if the write was successful.