Clip Makers
BaseClipMaker
Bases: BaseModel
, Generic[T]
, ABC
Base class for clip makers.
duration
class-attribute
instance-attribute
duration: NonNegativeFloat | None = None
The duration of the clip in seconds.
video_resolution
class-attribute
instance-attribute
The resolution of the video.
effects
class-attribute
instance-attribute
List of effects to apply to the clip.
storage_options
class-attribute
instance-attribute
Storage options for the media.
make_clip
make_clip(asset: T) -> Clip
Make a clip from the given clip, duration and video resolution.
:asset: The asset to make the clip from. :duration: The duration of the clip in seconds. :video_resolution: The resolution of the video.
Returns:
Type | Description |
---|---|
Clip
|
The clip. |
Source code in src/mosaico/clip_makers/base.py
get_clip_maker_class
Get a clip maker class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asset_type |
AssetType
|
The assets type. |
required |
Returns:
Type | Description |
---|---|
type[ClipMaker]
|
The clip maker class. |
Raises:
Type | Description |
---|---|
ValueError
|
If no clip maker is found for the given assets type and name. |
Source code in src/mosaico/clip_makers/factory.py
make_clip
make_clip(
asset: Asset,
duration: float | None = None,
video_resolution: FrameSize | None = None,
effects: Sequence[Effect] | None = None,
storage_options: dict[str, Any] | None = None,
**kwargs: Any
) -> Clip
Make a clip from the given asset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asset |
Asset
|
The asset. |
required |
duration |
float | None
|
The duration of the clip. |
None
|
video_resolution |
FrameSize | None
|
The resolution of the video. |
None
|
Returns:
Type | Description |
---|---|
Clip
|
The clip. |