From e3db71d80aacbf34b2d6f2e349675c5638985ec4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:02:07 +0000 Subject: [PATCH] Deployed a63f233 with MkDocs version: 1.6.1 --- .nojekyll | 0 404.html | 2721 ++ api-reference/asset-reference/index.html | 3986 +++ api-reference/assets/audio/index.html | 3925 +++ api-reference/assets/image/index.html | 3771 +++ api-reference/assets/index.html | 4314 ++++ api-reference/assets/subtitle/index.html | 3213 +++ api-reference/assets/text/index.html | 3953 +++ .../audio-transcribers/assemblyai/index.html | 3262 +++ api-reference/audio-transcribers/index.html | 3011 +++ .../audio-transcribers/openai/index.html | 3318 +++ api-reference/clip-makers/audio/index.html | 2921 +++ api-reference/clip-makers/image/index.html | 2932 +++ api-reference/clip-makers/index.html | 3513 +++ api-reference/clip-makers/subtitle/index.html | 2922 +++ api-reference/clip-makers/text/index.html | 2968 +++ api-reference/effects/index.html | 3018 +++ api-reference/effects/pan/index.html | 3558 +++ api-reference/effects/zoom/index.html | 3511 +++ api-reference/media/index.html | 4088 +++ api-reference/positioning/absolute/index.html | 3331 +++ api-reference/positioning/index.html | 3336 +++ api-reference/positioning/region/index.html | 3253 +++ api-reference/positioning/relative/index.html | 3045 +++ api-reference/scene/index.html | 3726 +++ api-reference/script-generators/index.html | 3007 +++ .../script-generators/script/index.html | 3524 +++ .../speech-synthesizers/elevenlabs/index.html | 3555 +++ api-reference/speech-synthesizers/index.html | 3136 +++ .../speech-synthesizers/openai/index.html | 3408 +++ api-reference/video/index.html | 2867 +++ api-reference/video/project/index.html | 6118 +++++ api-reference/video/rendering/index.html | 3073 +++ assets/_mkdocstrings.css | 119 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.525ec568.min.js | 16 + assets/javascripts/bundle.525ec568.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++ .../workers/search.6ce7567c.min.js | 42 + .../workers/search.6ce7567c.min.js.map | 7 + assets/logo.png | Bin 0 -> 1415 bytes assets/stylesheets/main.8c3ca2c6.min.css | 1 + assets/stylesheets/main.8c3ca2c6.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + .../asset-references-and-scenes/index.html | 3222 +++ concepts/audio-transcriptors/index.html | 3279 +++ concepts/effects/index.html | 3210 +++ concepts/index.html | 2804 ++ concepts/media-and-assets/index.html | 3466 +++ concepts/positioning/index.html | 3303 +++ concepts/script-generators/index.html | 3358 +++ concepts/speech-synthesizers/index.html | 3215 +++ concepts/video-projects/index.html | 3440 +++ cookbook/adding-audio/index.html | 2839 ++ cookbook/adding-images/index.html | 2818 ++ cookbook/adding-subtitles/index.html | 2837 ++ cookbook/basic-video/index.html | 2807 ++ cookbook/creating-custom-effects/index.html | 2843 ++ cookbook/index.html | 2885 +++ cookbook/multilayer-scene/index.html | 2830 ++ cookbook/project-config/index.html | 2814 ++ cookbook/slide-show/index.html | 2822 ++ cookbook/syncing-audio/index.html | 2845 ++ cookbook/text-animation/index.html | 2847 ++ cookbook/timed-transition/index.html | 2849 ++ cookbook/timeline-management/index.html | 2817 ++ cookbook/video-from-article/index.html | 2820 ++ css/print-site-enum-headings1.css | 75 + css/print-site-enum-headings2.css | 46 + css/print-site-enum-headings3.css | 52 + css/print-site-enum-headings4.css | 49 + css/print-site-enum-headings5.css | 49 + css/print-site-enum-headings6.css | 49 + css/print-site-material.css | 38 + css/print-site.css | 220 + development/contributing/index.html | 2964 +++ getting-started/architecture/index.html | 2997 +++ getting-started/installation/index.html | 2929 +++ getting-started/quick-start/index.html | 3126 +++ index.html | 2848 ++ integrations/frameworks/haystack/index.html | 2790 ++ integrations/frameworks/langchain/index.html | 2790 ++ integrations/index.html | 2816 ++ integrations/platforms/assemblyai/index.html | 3070 +++ integrations/platforms/elevenlabs/index.html | 3122 +++ integrations/platforms/openai/index.html | 3138 +++ js/print-site.js | 149 + objects.inv | Bin 0 -> 3205 bytes overrides/main.html | 5 + print_page/index.html | 21421 ++++++++++++++++ pt/api-reference/asset-reference/index.html | 4006 +++ pt/api-reference/assets/audio/index.html | 3945 +++ pt/api-reference/assets/image/index.html | 3791 +++ pt/api-reference/assets/index.html | 4334 ++++ pt/api-reference/assets/subtitle/index.html | 3233 +++ pt/api-reference/assets/text/index.html | 3973 +++ .../audio-transcribers/assemblyai/index.html | 3282 +++ .../audio-transcribers/index.html | 3031 +++ .../audio-transcribers/openai/index.html | 3338 +++ pt/api-reference/clip-makers/audio/index.html | 2941 +++ pt/api-reference/clip-makers/image/index.html | 2952 +++ pt/api-reference/clip-makers/index.html | 3533 +++ .../clip-makers/subtitle/index.html | 2942 +++ pt/api-reference/clip-makers/text/index.html | 2988 +++ pt/api-reference/effects/index.html | 3038 +++ pt/api-reference/effects/pan/index.html | 3578 +++ pt/api-reference/effects/zoom/index.html | 3531 +++ pt/api-reference/media/index.html | 4108 +++ .../positioning/absolute/index.html | 3351 +++ pt/api-reference/positioning/index.html | 3356 +++ .../positioning/region/index.html | 3273 +++ .../positioning/relative/index.html | 3065 +++ pt/api-reference/scene/index.html | 3746 +++ pt/api-reference/script-generators/index.html | 3027 +++ .../script-generators/script/index.html | 3544 +++ .../speech-synthesizers/elevenlabs/index.html | 3575 +++ .../speech-synthesizers/index.html | 3156 +++ .../speech-synthesizers/openai/index.html | 3428 +++ pt/api-reference/video/index.html | 2887 +++ pt/api-reference/video/project/index.html | 6138 +++++ pt/api-reference/video/rendering/index.html | 3093 +++ .../asset-references-and-scenes/index.html | 3242 +++ pt/concepts/audio-transcriptors/index.html | 3299 +++ pt/concepts/effects/index.html | 3230 +++ pt/concepts/index.html | 2824 ++ pt/concepts/media-and-assets/index.html | 3486 +++ pt/concepts/positioning/index.html | 3323 +++ pt/concepts/script-generators/index.html | 3378 +++ pt/concepts/speech-synthesizers/index.html | 3235 +++ pt/concepts/video-projects/index.html | 3460 +++ pt/cookbook/adding-audio/index.html | 2859 +++ pt/cookbook/adding-images/index.html | 2838 ++ pt/cookbook/adding-subtitles/index.html | 2857 +++ pt/cookbook/basic-video/index.html | 2827 ++ .../creating-custom-effects/index.html | 2863 +++ pt/cookbook/index.html | 2905 +++ pt/cookbook/multilayer-scene/index.html | 2850 ++ pt/cookbook/project-config/index.html | 2834 ++ pt/cookbook/slide-show/index.html | 2842 ++ pt/cookbook/syncing-audio/index.html | 2865 +++ pt/cookbook/text-animation/index.html | 2867 +++ pt/cookbook/timed-transition/index.html | 2869 +++ pt/cookbook/timeline-management/index.html | 2837 ++ pt/cookbook/video-from-article/index.html | 2840 ++ pt/development/contributing/index.html | 2984 +++ pt/getting-started/architecture/index.html | 3017 +++ pt/getting-started/installation/index.html | 2949 +++ pt/getting-started/quick-start/index.html | 3146 +++ pt/index.html | 2868 +++ .../frameworks/haystack/index.html | 2810 ++ .../frameworks/langchain/index.html | 2810 ++ pt/integrations/index.html | 2836 ++ .../platforms/assemblyai/index.html | 3090 +++ .../platforms/elevenlabs/index.html | 3142 +++ pt/integrations/platforms/openai/index.html | 3158 +++ pt/roadmap/index.html | 2989 +++ roadmap/index.html | 2969 +++ search/search_index.json | 1 + sitemap.xml | 927 + sitemap.xml.gz | Bin 0 -> 2143 bytes stylesheets/extra.css | 164 + 195 files changed, 458866 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 api-reference/asset-reference/index.html create mode 100644 api-reference/assets/audio/index.html create mode 100644 api-reference/assets/image/index.html create mode 100644 api-reference/assets/index.html create mode 100644 api-reference/assets/subtitle/index.html create mode 100644 api-reference/assets/text/index.html create mode 100644 api-reference/audio-transcribers/assemblyai/index.html create mode 100644 api-reference/audio-transcribers/index.html create mode 100644 api-reference/audio-transcribers/openai/index.html create mode 100644 api-reference/clip-makers/audio/index.html create mode 100644 api-reference/clip-makers/image/index.html create mode 100644 api-reference/clip-makers/index.html create mode 100644 api-reference/clip-makers/subtitle/index.html create mode 100644 api-reference/clip-makers/text/index.html create mode 100644 api-reference/effects/index.html create mode 100644 api-reference/effects/pan/index.html create mode 100644 api-reference/effects/zoom/index.html create mode 100644 api-reference/media/index.html create mode 100644 api-reference/positioning/absolute/index.html create mode 100644 api-reference/positioning/index.html create mode 100644 api-reference/positioning/region/index.html create mode 100644 api-reference/positioning/relative/index.html create mode 100644 api-reference/scene/index.html create mode 100644 api-reference/script-generators/index.html create mode 100644 api-reference/script-generators/script/index.html create mode 100644 api-reference/speech-synthesizers/elevenlabs/index.html create mode 100644 api-reference/speech-synthesizers/index.html create mode 100644 api-reference/speech-synthesizers/openai/index.html create mode 100644 api-reference/video/index.html create mode 100644 api-reference/video/project/index.html create mode 100644 api-reference/video/rendering/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.525ec568.min.js create mode 100644 assets/javascripts/bundle.525ec568.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js.map create mode 100644 assets/logo.png create mode 100644 assets/stylesheets/main.8c3ca2c6.min.css create mode 100644 assets/stylesheets/main.8c3ca2c6.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 concepts/asset-references-and-scenes/index.html create mode 100644 concepts/audio-transcriptors/index.html create mode 100644 concepts/effects/index.html create mode 100644 concepts/index.html create mode 100644 concepts/media-and-assets/index.html create mode 100644 concepts/positioning/index.html create mode 100644 concepts/script-generators/index.html create mode 100644 concepts/speech-synthesizers/index.html create mode 100644 concepts/video-projects/index.html create mode 100644 cookbook/adding-audio/index.html create mode 100644 cookbook/adding-images/index.html create mode 100644 cookbook/adding-subtitles/index.html create mode 100644 cookbook/basic-video/index.html create mode 100644 cookbook/creating-custom-effects/index.html create mode 100644 cookbook/index.html create mode 100644 cookbook/multilayer-scene/index.html create mode 100644 cookbook/project-config/index.html create mode 100644 cookbook/slide-show/index.html create mode 100644 cookbook/syncing-audio/index.html create mode 100644 cookbook/text-animation/index.html create mode 100644 cookbook/timed-transition/index.html create mode 100644 cookbook/timeline-management/index.html create mode 100644 cookbook/video-from-article/index.html create mode 100644 css/print-site-enum-headings1.css create mode 100644 css/print-site-enum-headings2.css create mode 100644 css/print-site-enum-headings3.css create mode 100644 css/print-site-enum-headings4.css create mode 100644 css/print-site-enum-headings5.css create mode 100644 css/print-site-enum-headings6.css create mode 100644 css/print-site-material.css create mode 100644 css/print-site.css create mode 100644 development/contributing/index.html create mode 100644 getting-started/architecture/index.html create mode 100644 getting-started/installation/index.html create mode 100644 getting-started/quick-start/index.html create mode 100644 index.html create mode 100644 integrations/frameworks/haystack/index.html create mode 100644 integrations/frameworks/langchain/index.html create mode 100644 integrations/index.html create mode 100644 integrations/platforms/assemblyai/index.html create mode 100644 integrations/platforms/elevenlabs/index.html create mode 100644 integrations/platforms/openai/index.html create mode 100644 js/print-site.js create mode 100644 objects.inv create mode 100644 overrides/main.html create mode 100644 print_page/index.html create mode 100644 pt/api-reference/asset-reference/index.html create mode 100644 pt/api-reference/assets/audio/index.html create mode 100644 pt/api-reference/assets/image/index.html create mode 100644 pt/api-reference/assets/index.html create mode 100644 pt/api-reference/assets/subtitle/index.html create mode 100644 pt/api-reference/assets/text/index.html create mode 100644 pt/api-reference/audio-transcribers/assemblyai/index.html create mode 100644 pt/api-reference/audio-transcribers/index.html create mode 100644 pt/api-reference/audio-transcribers/openai/index.html create mode 100644 pt/api-reference/clip-makers/audio/index.html create mode 100644 pt/api-reference/clip-makers/image/index.html create mode 100644 pt/api-reference/clip-makers/index.html create mode 100644 pt/api-reference/clip-makers/subtitle/index.html create mode 100644 pt/api-reference/clip-makers/text/index.html create mode 100644 pt/api-reference/effects/index.html create mode 100644 pt/api-reference/effects/pan/index.html create mode 100644 pt/api-reference/effects/zoom/index.html create mode 100644 pt/api-reference/media/index.html create mode 100644 pt/api-reference/positioning/absolute/index.html create mode 100644 pt/api-reference/positioning/index.html create mode 100644 pt/api-reference/positioning/region/index.html create mode 100644 pt/api-reference/positioning/relative/index.html create mode 100644 pt/api-reference/scene/index.html create mode 100644 pt/api-reference/script-generators/index.html create mode 100644 pt/api-reference/script-generators/script/index.html create mode 100644 pt/api-reference/speech-synthesizers/elevenlabs/index.html create mode 100644 pt/api-reference/speech-synthesizers/index.html create mode 100644 pt/api-reference/speech-synthesizers/openai/index.html create mode 100644 pt/api-reference/video/index.html create mode 100644 pt/api-reference/video/project/index.html create mode 100644 pt/api-reference/video/rendering/index.html create mode 100644 pt/concepts/asset-references-and-scenes/index.html create mode 100644 pt/concepts/audio-transcriptors/index.html create mode 100644 pt/concepts/effects/index.html create mode 100644 pt/concepts/index.html create mode 100644 pt/concepts/media-and-assets/index.html create mode 100644 pt/concepts/positioning/index.html create mode 100644 pt/concepts/script-generators/index.html create mode 100644 pt/concepts/speech-synthesizers/index.html create mode 100644 pt/concepts/video-projects/index.html create mode 100644 pt/cookbook/adding-audio/index.html create mode 100644 pt/cookbook/adding-images/index.html create mode 100644 pt/cookbook/adding-subtitles/index.html create mode 100644 pt/cookbook/basic-video/index.html create mode 100644 pt/cookbook/creating-custom-effects/index.html create mode 100644 pt/cookbook/index.html create mode 100644 pt/cookbook/multilayer-scene/index.html create mode 100644 pt/cookbook/project-config/index.html create mode 100644 pt/cookbook/slide-show/index.html create mode 100644 pt/cookbook/syncing-audio/index.html create mode 100644 pt/cookbook/text-animation/index.html create mode 100644 pt/cookbook/timed-transition/index.html create mode 100644 pt/cookbook/timeline-management/index.html create mode 100644 pt/cookbook/video-from-article/index.html create mode 100644 pt/development/contributing/index.html create mode 100644 pt/getting-started/architecture/index.html create mode 100644 pt/getting-started/installation/index.html create mode 100644 pt/getting-started/quick-start/index.html create mode 100644 pt/index.html create mode 100644 pt/integrations/frameworks/haystack/index.html create mode 100644 pt/integrations/frameworks/langchain/index.html create mode 100644 pt/integrations/index.html create mode 100644 pt/integrations/platforms/assemblyai/index.html create mode 100644 pt/integrations/platforms/elevenlabs/index.html create mode 100644 pt/integrations/platforms/openai/index.html create mode 100644 pt/roadmap/index.html create mode 100644 roadmap/index.html create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 stylesheets/extra.css diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..106698b --- /dev/null +++ b/404.html @@ -0,0 +1,2721 @@ + + + +
+ + + + + + + + + + + + + + +
AssetReference
+
+
+
+ Bases: BaseModel
Represents an asset used in a scene.
+ + + + +
asset_id
+
+
+
+ instance-attribute
+
+
+asset_id: str
+
The ID of the asset.
+
asset_type
+
+
+
+ instance-attribute
+
+
+asset_type: AssetType
+
The refered asset type.
+
asset_params
+
+
+
+ class-attribute
+ instance-attribute
+
+
+asset_params: AssetParams | None = None
+
The asset reference params.
+
start_time
+
+
+
+ class-attribute
+ instance-attribute
+
+
+start_time: NonNegativeFloat = 0
+
The start time of the asset in seconds.
+
end_time
+
+
+
+ class-attribute
+ instance-attribute
+
+
+end_time: NonNegativeFloat = 0
+
The end time of the asset in seconds.
+
effects
+
+
+
+ class-attribute
+ instance-attribute
+
+
+effects: list[VideoEffect] = Field(default_factory=list)
+
The effects to apply to the asset.
+
duration
+
+
+
+ property
+
+
+duration: float
+
The duration of the asset in seconds.
+
from_asset
+
+
+
+ classmethod
+
+
+from_asset(
+ asset: Asset,
+ *,
+ asset_params: AssetParams | None = None,
+ start_time: float | None = None,
+ end_time: float | None = None,
+ effects: Sequence[VideoEffect] | None = None
+) -> AssetReference
+
Create an asset reference from an asset.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset |
+
+ Asset
+ |
+
+
+
+ The asset to reference. + |
+ + required + | +
asset_params |
+
+ AssetParams | None
+ |
+
+
+
+ The asset params. + |
+
+ None
+ |
+
start_time |
+
+ float | None
+ |
+
+
+
+ The start time of the asset in seconds. + |
+
+ None
+ |
+
end_time |
+
+ float | None
+ |
+
+
+
+ The end time of the asset in seconds. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
from_dict
+
+
+
+ classmethod
+
+
+from_dict(data: Mapping[str, Any]) -> AssetReference
+
Create an asset reference from a dictionary.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ Mapping[str, Any]
+ |
+
+
+
+ The dictionary data. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
with_params
+
+
+with_params(params: AssetParams) -> AssetReference
+
Add scene params to the asset reference.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
params |
+
+ AssetParams
+ |
+
+
+
+ The scene params to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
with_start_time
+
+
+with_start_time(start_time: float) -> AssetReference
+
Add a start time to the asset reference.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
start_time |
+
+ float
+ |
+
+
+
+ The start time to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
with_end_time
+
+
+with_end_time(end_time: float) -> AssetReference
+
Add an end time to the asset reference.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
end_time |
+
+ float
+ |
+
+
+
+ The end time to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
with_effects
+
+
+with_effects(effects: Sequence[Effect]) -> AssetReference
+
Add effects to the asset reference.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
effects |
+
+ Sequence[Effect]
+ |
+
+
+
+ The effects to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetReference
+ |
+
+
+
+ The asset reference. + |
+
src/mosaico/assets/reference.py
AudioAssetParams
+
+
+
+ Bases: BaseModel
Represents the parameters for an Audio assets.
+ + + + +
volume
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The volume of the audio assets.
+
AudioAsset
+
+
+
+ Bases: BaseAsset[AudioAssetParams]
Represents an Audio asset with various properties.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['audio'] = 'audio'
+
The type of the asset. Defaults to "audio".
+
params
+
+
+
+ class-attribute
+ instance-attribute
+
+
+params: AudioAssetParams = Field(
+ default_factory=AudioAssetParams
+)
+
The parameters for the asset.
+
duration
+
+
+
+ instance-attribute
+
+
+duration: PositiveFloat
+
The duration of the audio asset.
+
sample_rate
+
+
+
+ instance-attribute
+
+
+sample_rate: PositiveFloat
+
The sample rate of the audio asset.
+
sample_width
+
+
+
+ instance-attribute
+
+
+sample_width: NonNegativeInt
+
The sample width of the audio asset.
+
channels
+
+
+
+ instance-attribute
+
+
+channels: int
+
The number of channels in the audio asset.
+
from_data
+
+
+
+ classmethod
+
+
+from_data(
+ data: str | bytes,
+ *,
+ path: PathLike | None = None,
+ metadata: dict | None = None,
+ mime_type: str | None = None,
+ **kwargs: Any
+) -> Self
+
Creates an audio asset from data.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ str | bytes
+ |
+
+
+
+ The data of the assets. + |
+ + required + | +
path |
+
+ PathLike | None
+ |
+
+
+
+ The path to the file. + |
+
+ None
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the assets. + |
+
+ None
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the assets. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The assets. + |
+
src/mosaico/assets/audio.py
from_path
+
+
+
+ classmethod
+
+
+from_path(
+ path: PathLike,
+ *,
+ encoding: str = "utf-8",
+ mime_type: str | None = None,
+ guess_mime_type: bool = True,
+ metadata: dict | None = None,
+ **kwargs: Any
+) -> Self
+
Creates an audio asset from a file path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
path |
+
+ PathLike
+ |
+
+
+
+ The path to the file. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ The encoding of the file. + |
+
+ 'utf-8'
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the assets. + |
+
+ None
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the assets. + |
+
+ None
+ |
+
guess_mime_type |
+
+ bool
+ |
+
+
+
+ Whether to guess the MIME type. + |
+
+ True
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The assets. + |
+
src/mosaico/assets/audio.py
slice
+
+
+slice(start_time: float, end_time: float) -> AudioAsset
+
Slices the audio asset.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
start_time |
+
+ float
+ |
+
+
+
+ The start time in seconds. + |
+ + required + | +
end_time |
+
+ float
+ |
+
+
+
+ The end time in seconds. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AudioAsset
+ |
+
+
+
+ The sliced audio asset. + |
+
src/mosaico/assets/audio.py
ImageAssetParams
+
+
+
+ Bases: BaseModel
Represents the parameters for an image assets.
+ + + + +
position
+
+
+
+ class-attribute
+ instance-attribute
+
+
+position: Position = Field(default_factory=AbsolutePosition)
+
The positioning of the text assets in the video.
+
z_index
+
+
+
+ class-attribute
+ instance-attribute
+
+
+z_index: int = -1
+
The z-index of the assets.
+
crop
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The crop range for the image assets.
+
as_background
+
+
+
+ class-attribute
+ instance-attribute
+
+
+as_background: bool = True
+
Whether the image should be used as a background.
+
ImageAsset
+
+
+
+ Bases: BaseAsset[ImageAssetParams]
Represents an image assets with various properties.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['image'] = 'image'
+
The type of the assets. Defaults to "image".
+
params
+
+
+
+ class-attribute
+ instance-attribute
+
+
+params: ImageAssetParams = Field(
+ default_factory=ImageAssetParams
+)
+
The parameters for the assets.
+
width
+
+
+
+ instance-attribute
+
+
+width: NonNegativeInt
+
The width of the image.
+
height
+
+
+
+ instance-attribute
+
+
+height: NonNegativeInt
+
The height of the image.
+
from_data
+
+
+
+ classmethod
+
+
+from_data(
+ data: str | bytes,
+ *,
+ path: PathLike | None = None,
+ metadata: dict | None = None,
+ mime_type: str | None = None,
+ **kwargs: Any
+) -> Self
+
Creates an image asset from data.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ str | bytes
+ |
+
+
+
+ The data of the assets. + |
+ + required + | +
path |
+
+ PathLike | None
+ |
+
+
+
+ The path to the file. + |
+
+ None
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the assets. + |
+
+ None
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the assets. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The assets. + |
+
src/mosaico/assets/image.py
from_path
+
+
+
+ classmethod
+
+
+from_path(
+ path: PathLike,
+ *,
+ encoding: str = "utf-8",
+ mime_type: str | None = None,
+ guess_mime_type: bool = True,
+ metadata: dict | None = None,
+ **kwargs: Any
+) -> Self
+
Creates an image asset from a file path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
path |
+
+ PathLike
+ |
+
+
+
+ The path to the file. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ The encoding of the file. + |
+
+ 'utf-8'
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the assets. + |
+
+ None
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the assets. + |
+
+ None
+ |
+
guess_mime_type |
+
+ bool
+ |
+
+
+
+ Whether to guess the MIME type. + |
+
+ True
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The assets. + |
+
src/mosaico/assets/image.py
BaseAsset
+
+
+Represents an assets with various properties.
+ + + + +
params
+
+
+
+ instance-attribute
+
+
+The parameters for the assets.
+
from_media
+
+
+
+ classmethod
+
+
+
from_dict
+
+
+
+ classmethod
+
+
+
validate_params
+
+
+
+ classmethod
+
+
+validate_params(params: Any) -> T
+
Validates the parameters for the assets.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
params |
+
+ Any
+ |
+
+
+
+ The parameters to validate. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ T
+ |
+
+
+
+ The validated parameters. + |
+
src/mosaico/assets/base.py
with_params
+
+
+Returns a new assets with the specified parameters.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
params |
+
+ T | dict[str, Any]
+ |
+
+
+
+ The parameters to update. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ A new assets with the specified parameters. + |
+
src/mosaico/assets/base.py
AssetType
+
+
+
+ module-attribute
+
+
+AssetType = Literal[
+ "video", "image", "audio", "text", "subtitle"
+]
+
An enumeration of the different types of assets that can be held in an assets.
+
Asset
+
+
+
+ module-attribute
+
+
+Asset = AudioAsset | ImageAsset | TextAsset | SubtitleAsset
+
Represents an assets with various properties.
+
AssetParams
+
+
+
+ module-attribute
+
+
+AssetParams = (
+ AudioAssetParams | ImageAssetParams | TextAssetParams
+)
+
Represents the parameters of an assets.
+
create_asset
+
+
+create_asset(
+ asset_type: AssetType,
+ id: str | None = None,
+ data: str | bytes | None = None,
+ path: PathLike | None = None,
+ metadata: dict[str, Any] | None = None,
+ params: AssetParams | dict[str, Any] | None = None,
+ **kwargs: Any
+) -> Asset
+
Create an asset from the given asset type.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset_type |
+
+ AssetType
+ |
+
+
+
+ The asset type. + |
+ + required + | +
id |
+
+ str | None
+ |
+
+
+
+ The asset ID. + |
+
+ None
+ |
+
data |
+
+ str | bytes | None
+ |
+
+
+
+ The asset data. + |
+
+ None
+ |
+
path |
+
+ PathLike | None
+ |
+
+
+
+ The asset path. + |
+
+ None
+ |
+
metadata |
+
+ dict[str, Any] | None
+ |
+
+
+
+ The asset metadata. ;param params: The asset parameters. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Asset
+ |
+
+
+
+ The asset. + |
+
src/mosaico/assets/factory.py
get_asset_params_class
+
+
+get_asset_params_class(
+ asset_type: AssetType,
+) -> type[AssetParams]
+
Get the asset parameters class for the given asset type.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset_type |
+
+ AssetType
+ |
+
+
+
+ The asset type. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ type[AssetParams]
+ |
+
+
+
+ The asset parameters class. + |
+
src/mosaico/assets/factory.py
convert_media_to_asset
+
+
+Convert a media object to an asset.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
media |
+
+ Media
+ |
+
+
+
+ The media object to convert. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Asset
+ |
+
+
+
+ The asset object. + |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If the media object does not have a MIME type or the MIME type is unsupported. + |
+
src/mosaico/assets/utils.py
guess_asset_type_from_mime_type
+
+
+Guess the asset type from a MIME type.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mime_type |
+
+ str
+ |
+
+
+
+ The MIME type to guess the asset type from. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AssetType
+ |
+
+
+
+ The asset type. + |
+
src/mosaico/assets/utils.py
check_user_provided_required_keys
+
+
+Check if the user provided all required keys.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ dict
+ |
+
+
+
+ The data to check. + |
+ + required + | +
required_keys |
+
+ Sequence[str]
+ |
+
+
+
+ The required keys. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Whether the user provided all required keys. + |
+
src/mosaico/assets/utils.py
SubtitleAsset
+
+
+
+ Bases: BaseTextAsset
Represents a subtitles assets.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['subtitle'] = 'subtitle'
+
The type of the assets. Defaults to "subtitle".
+
params
+
+
+
+ class-attribute
+ instance-attribute
+
+
+params: TextAssetParams = Field(
+ default_factory=lambda: TextAssetParams(
+ position=RegionPosition(x="center", y="bottom"),
+ font_color=Color("white"),
+ font_size=45,
+ stroke_width=1,
+ align="center",
+ shadow_blur=10,
+ shadow_angle=135,
+ shadow_opacity=0.5,
+ shadow_distance=5,
+ )
+)
+
The parameters for the assets.
+
check_position_is_region
+
+
+
+ classmethod
+
+
+check_position_is_region(
+ params: TextAssetParams,
+) -> TextAssetParams
+
Validate that the subtitle positioning is of type RegionPosition.
+ +src/mosaico/assets/subtitle.py
from_shot
+
+
+
+ classmethod
+
+
+from_shot(shot: Shot, **kwargs: Any) -> SubtitleAsset
+
Create a SubtitleAsset from a Shot.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
shot |
+
+ Shot
+ |
+
+
+
+ The shot to create the asset from. + |
+ + required + | +
kwargs |
+
+ Any
+ |
+
+
+
+ Additional parameters for the asset. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ SubtitleAsset
+ |
+
+
+
+ The created asset. + |
+
src/mosaico/assets/subtitle.py
TextAssetParams
+
+
+
+ Bases: BaseModel
Represents the parameters for a text assets.
+ + + + +
position
+
+
+
+ class-attribute
+ instance-attribute
+
+
+position: Position = Field(default_factory=AbsolutePosition)
+
The positioning of the text assets in the video.
+
font_family
+
+
+
+ class-attribute
+ instance-attribute
+
+
+font_family: str = 'Arial Bold'
+
The font family.
+
font_size
+
+
+
+ class-attribute
+ instance-attribute
+
+
+font_size: NonNegativeInt = 70
+
The font size.
+
font_color
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The font color hexadecimal code.
+
font_kerning
+
+
+
+ class-attribute
+ instance-attribute
+
+
+font_kerning: float = 0
+
The font kerning.
+
line_height
+
+
+
+ class-attribute
+ instance-attribute
+
+
+line_height: int = 10
+
The line height.
+
stroke_color
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The font stroke color hexadecimal code.
+
stroke_width
+
+
+
+ class-attribute
+ instance-attribute
+
+
+stroke_width: NonNegativeFloat = 0
+
The font stroke width.
+
shadow_color
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The shadow color hexadecimal code.
+
shadow_blur
+
+
+
+ class-attribute
+ instance-attribute
+
+
+shadow_blur: int = 0
+
The shadow blur.
+
shadow_opacity
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The shadow opacity.
+
shadow_angle
+
+
+
+ class-attribute
+ instance-attribute
+
+
+shadow_angle: int = 0
+
The shadow angle.
+
shadow_distance
+
+
+
+ class-attribute
+ instance-attribute
+
+
+shadow_distance: NonNegativeInt = 0
+
The shadow distance.
+
background_color
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The background color hexadecimal code.
+
align
+
+
+
+ class-attribute
+ instance-attribute
+
+
+align: Literal['left', 'center', 'right'] = 'left'
+
The text alignment.
+
z_index
+
+
+
+ class-attribute
+ instance-attribute
+
+
+z_index: int = 0
+
The z-index of the assets.
+
serialize_color
+
+
+Serialize the color to its hexadecimal code.
+ + +
BaseTextAsset
+
+
+
+ Bases: BaseAsset[TextAssetParams]
Represents a text assets with various properties.
+ + + + +
params
+
+
+
+ class-attribute
+ instance-attribute
+
+
+params: TextAssetParams = Field(
+ default_factory=TextAssetParams
+)
+
The parameters for the text assets.
+
has_background
+
+
+
+ property
+
+
+has_background: bool
+
Check if the text asset has a background.
+
has_shadow
+
+
+
+ property
+
+
+has_shadow: bool
+
Check if the text asset has a shadow.
+
TextAsset
+
+
+
+ Bases: BaseTextAsset
Represents a text assets with various properties.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['text'] = 'text'
+
¨The type of the assets. Defaults to "text".
+
AssemblyAIAudioTranscriber
+
+
+
+ Bases: BaseModel
Transcriber using AssemblyAI's API.
+ + + + +
api_key
+
+
+
+ class-attribute
+ instance-attribute
+
+
+api_key: str | None = None
+
API key for AssemblyAI.
+
model
+
+
+
+ class-attribute
+ instance-attribute
+
+
+model: Literal['best', 'nano'] = 'best'
+
Model to use for transcription.
+
language
+
+
+
+ class-attribute
+ instance-attribute
+
+
+language: LanguageAlpha2 | None = None
+
Language of the transcription.
+
custom_spelling
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Custom spelling dictionary for the transcription.
+
transcribe
+
+
+transcribe(audio_asset: AudioAsset) -> Transcription
+
Transcribe audio using AssemblyAI's API.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
audio_asset |
+
+ AudioAsset
+ |
+
+
+
+
+ |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Transcription
+ |
+
+
+
+ The transcription. + |
+
src/mosaico/audio_transcribers/assemblyai.py
AudioTranscriber
+
+
+
+ Bases: Protocol
A protocol defining the interface for audio transcription services.
+This protocol specifies the contract that all audio transcribers in the Mosaico
+project should adhere to. It defines a single method, :meth:transcribe
, which
+takes an audio asset and returns a transcription.
Implementations of this protocol can use various transcription technologies, +such as speech-to-text APIs, local models, or custom algorithms. The protocol +ensures a consistent interface regardless of the underlying implementation.
+Note
+This is a runtime checkable protocol, which means isinstance()
and
+issubclass()
checks can be performed against it.
Example:
+ class MyTranscriber:
+ def transcribe(self, audio_asset: AudioAsset) -> Transcription:
+ # Implement transcription logic here
+ ...
+
+ transcriber: AudioTranscriber = MyTranscriber()
+ transcription = transcriber.transcribe(my_audio_asset)
+
transcribe
+
+
+transcribe(audio_asset: AudioAsset) -> Transcription
+
Transcribe speech from an audio asset to text.
+This method should implement the core logic for converting speech in the +provided audio asset into text. The specific implementation can vary +based on the transcription technology being used.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
audio_asset |
+
+ AudioAsset
+ |
+
+
+
+ The audio asset containing the speech to be transcribed. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Transcription
+ |
+
+
+
+ A Transcription object containing the text transcription of the speech. .. note:: The implementation should handle various audio formats and durations as defined by the :class: |
+
src/mosaico/audio_transcribers/protocol.py
OpenAIWhisperTranscriber
+
+
+
+ Bases: BaseModel
Transcriber using OpenAI's Whisper API.
+ + + + +
api_key
+
+
+
+ class-attribute
+ instance-attribute
+
+
+api_key: str | None = None
+
API key for OpenAI's Whisper API.
+
base_url
+
+
+
+ class-attribute
+ instance-attribute
+
+
+base_url: str | None = None
+
Base URL for OpenAI's Whisper API.
+
timeout
+
+
+
+ class-attribute
+ instance-attribute
+
+
+timeout: PositiveInt = 120
+
Timeout for transcription in seconds.
+
model
+
+
+
+ class-attribute
+ instance-attribute
+
+
+model: Literal['whisper-1'] = 'whisper-1'
+
Model to use for transcription.
+
temperature
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The sampling temperature for the model.
+
language
+
+
+
+ class-attribute
+ instance-attribute
+
+
+language: LanguageAlpha2 | None = None
+
Language of the transcription.
+
transcribe
+
+
+transcribe(audio_asset: AudioAsset) -> Transcription
+
Transcribe audio using OpenAI's Whisper API.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
audio_asset |
+
+ AudioAsset
+ |
+
+
+
+ The audio asset to transcribe. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Transcription
+ |
+
+
+
+ The transcription words. + |
+
src/mosaico/audio_transcribers/openai.py
AudioClipMaker
+
+
+
+ Bases: BaseClipMaker[AudioAsset]
A clip maker for audio assets.
+The audio clip maker performs these transformations:
+Examples:
+# Create a basic audio clip
+maker = AudioClipMaker(duration=5.0)
+clip = maker.make_clip(audio_asset)
+
+# Create clip with custom duration
+clip = maker.make_clip(audio_asset, duration=10.0)
+
ImageClipMaker
+
+
+
+ Bases: BaseClipMaker[ImageAsset]
A clip maker for image assets.
+The image clip maker performs these transformations:
+Examples:
+# Create a basic image clip
+maker = ImageClipMaker(duration=5.0, video_resolution=(1920, 1080))
+clip = maker.make_clip(image_asset)
+
+# Create clip with background resize
+image_asset.params.as_background = True
+clip = maker.make_clip(image_asset) # Will resize to match resolution
+
+# Create clip with custom position
+image_asset.params.position = AbsolutePosition(x=100, y=50)
+clip = maker.make_clip(image_asset) # Will position at x=100, y=50
+
ClipMaker
+
+
+
+ Bases: Protocol[T_contra]
A protocol for 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.
+
make_clip
+
+
+make_clip(asset: T) -> Clip
+
Make a clip from the given clip, duration and video resolution.
+:clip: The clip 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. + |
+
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. + |
+
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,
+ **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. + |
+
src/mosaico/clip_makers/factory.py
SubtitleClipMaker
+
+
+
+ Bases: TextClipMaker
A clip maker for subtitle assets.
+The subtitle clip maker performs these transformations:
+Note
+For further details, refer to the TextClipMaker documentation.
+Examples:
+# Create a basic subtitle clip
+maker = SubtitleClipMaker(duration=5.0, video_resolution=(1920, 1080))
+clip = maker.make_clip(subtitle_asset)
+
TextClipMaker
+
+
+
+ Bases: BaseClipMaker[BaseTextAsset]
A clip maker for text assets.
+The process of text clip creation involves:
+Font and Text Preparation:
+Shadow Creation (if enabled):
+Text Rendering:
+Image Composition:
+Clip Creation:
+Examples:
+# Create a basic text clip
+maker = TextClipMaker(duration=5.0, video_resolution=(1920, 1080))
+clip = maker.make_clip(text_asset)
+
+# Create clip with shadow
+text_asset.params.has_shadow = True
+clip = maker.make_clip(text_asset) # Will add shadow effect
+
+# Create clip with custom position
+text_asset.params.position = AbsolutePosition(x=100, y=50)
+clip = maker.make_clip(text_asset) # Will position at x=100, y=50
+
+# Create clip with custom font size
+text_asset.params.font_size = 48
+clip = maker.make_clip(text_asset) # Will render text with font size 48
+
Effect
+
+
+
+ Bases: Protocol[ClipType]
A protocol for clip effects.
+Note
+This is a runtime checkable protocol, which means isinstance()
and
+issubclass()
checks can be performed against it.
VideoEffect
+
+
+
+ module-attribute
+
+
+VideoEffect = (
+ ZoomInEffect
+ | ZoomOutEffect
+ | PanLeftEffect
+ | PanRightEffect
+ | PanUpEffect
+ | PanDownEffect
+)
+
A type representing any video effect.
+
VideoEffectType
+
+
+
+ module-attribute
+
+
+VideoEffectType = Literal[
+ "zoom_in",
+ "zoom_out",
+ "pan_left",
+ "pan_right",
+ "pan_up",
+ "pan_down",
+]
+
A type representing the type of a video effect.
+
PanFn
+
+
+
+ module-attribute
+
+
+The pan function type.
+
BasePanEffect
+
+
+
+ Bases: BaseModel
A pan effect.
+ + + + +
zoom_factor
+
+
+
+ class-attribute
+ instance-attribute
+
+
+zoom_factor: PositiveFloat = 1.1
+
The zoom factor.
+
apply
+
+
+Apply the pan effect to the clip.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
clip |
+
+ VideoClip
+ |
+
+
+
+ The clip. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoClip
+ |
+
+
+
+ The clip with the effect applied. + |
+
src/mosaico/effects/pan.py
PanRightEffect
+
+
+
+ Bases: BasePanEffect
A left to right pan effect.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['pan_right'] = 'pan_right'
+
Effect type. Must be "pan_right".
+
PanLeftEffect
+
+
+
+ Bases: BasePanEffect
A right to left pan effect.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['pan_left'] = 'pan_left'
+
Effect type. Must be "pan_left".
+
PanDownEffect
+
+
+
+ Bases: BasePanEffect
A top to bottom pan effect.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['pan_down'] = 'pan_down'
+
Effect type. Must be "pan_down".
+
PanUpEffect
+
+
+
+ Bases: BasePanEffect
A bottom to top pan effect.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['pan_up'] = 'pan_up'
+
Effect type. Must be "pan_up".
+
BaseZoomEffect
+
+
+
+ Bases: BaseModel
Base class for zoom effects.
+ + + + +
start_zoom
+
+
+
+ instance-attribute
+
+
+Starting zoom scale (1.0 is original size).
+
end_zoom
+
+
+
+ instance-attribute
+
+
+Ending zoom scale.
+
apply
+
+
+Apply zoom effect to clip.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
clip |
+
+ VideoClip
+ |
+
+
+
+ The clip to apply the effect to. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoClip
+ |
+
+
+
+ The clip with the effect applied. + |
+
src/mosaico/effects/zoom.py
ZoomInEffect
+
+
+
+ Bases: BaseZoomEffect
Zoom-in effect for video clips.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['zoom_in'] = 'zoom_in'
+
Effect type. Must be "zoom_in".
+
start_zoom
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Starting zoom scale (1.0 is original size).
+
ZoomOutEffect
+
+
+
+ Bases: BaseZoomEffect
Zoom-out effect for video clips.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['zoom_out'] = 'zoom_out'
+
Effect type. Must be "zoom_out".
+
start_zoom
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Starting zoom scale (1.5 times the original size).
+
Media
+
+
+
+ Bases: BaseModel
Represents a media object.
+ + + + +
id
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The unique identifier of the assets.
+
data
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The content of the media.
+
path
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The path to the media.
+
mime_type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+mime_type: str | None = None
+
The MIME type of the media.
+
encoding
+
+
+
+ class-attribute
+ instance-attribute
+
+
+encoding: str = 'utf-8'
+
The encoding of the media.
+
metadata
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The metadata of the media.
+
description
+
+
+
+ property
+
+
+description: str
+
Returns a description of the media.
+
credit
+
+
+
+ property
+
+
+credit: str
+
Returns the credits of the media.
+
validate_media
+
+
+
+ classmethod
+
+
+Validates the content of the media.
+ +src/mosaico/media.py
from_path
+
+
+
+ classmethod
+
+
+from_path(
+ path: PathLike,
+ *,
+ encoding: str = "utf-8",
+ mime_type: str | None = None,
+ guess_mime_type: bool = True,
+ metadata: dict | None = None,
+ **kwargs: Any
+) -> Self
+
Creates a media from a path.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
path |
+
+ PathLike
+ |
+
+
+
+ The path to the media. + |
+ + required + | +
encoding |
+
+ str
+ |
+
+
+
+ The encoding of the media. + |
+
+ 'utf-8'
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the media. + |
+
+ None
+ |
+
guess_mime_type |
+
+ bool
+ |
+
+
+
+ Whether to guess the MIME type. + |
+
+ True
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the media. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The media. + |
+
src/mosaico/media.py
from_data
+
+
+
+ classmethod
+
+
+from_data(
+ data: str | bytes,
+ *,
+ path: PathLike | None = None,
+ metadata: dict | None = None,
+ mime_type: str | None = None,
+ **kwargs: Any
+) -> Self
+
Creates a media from data.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ str | bytes
+ |
+
+
+
+ The data of the media. + |
+ + required + | +
path |
+
+ PathLike | None
+ |
+
+
+
+ The path to the media. + |
+
+ None
+ |
+
metadata |
+
+ dict | None
+ |
+
+
+
+ The metadata of the media. + |
+
+ None
+ |
+
mime_type |
+
+ str | None
+ |
+
+
+
+ The MIME type of the media. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to the constructor. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Self
+ |
+
+
+
+ The media. + |
+
src/mosaico/media.py
from_external
+
+
+
+ classmethod
+
+
+Converts an external representation to a media.
+ +src/mosaico/media.py
to_external
+
+
+Converts the media to an external representation.
+ +src/mosaico/media.py
to_string
+
+
+to_string() -> str
+
Returns the media as a string.
+ +src/mosaico/media.py
to_bytes
+
+
+to_bytes() -> bytes
+
Returns the media as bytes.
+ +src/mosaico/media.py
to_bytes_io
+
+
+to_bytes_io() -> Generator[BytesIO | BufferedReader]
+
Read data as a byte stream.
+ +src/mosaico/media.py
AbsolutePosition
+
+
+
+ Bases: BaseModel
Represents an absolute positioning.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['absolute'] = 'absolute'
+
The type of positioning. Defaults to "absolute".
+
x
+
+
+
+ class-attribute
+ instance-attribute
+
+
+x: NonNegativeInt = 0
+
The x-coordinate of the assets.
+
y
+
+
+
+ class-attribute
+ instance-attribute
+
+
+y: NonNegativeInt = 0
+
The y-coordinate of the assets.
+
from_relative
+
+
+
+ classmethod
+
+
+from_relative(
+ position: RelativePosition, frame_size: FrameSize
+) -> AbsolutePosition
+
Creates an absolute positioning from a relative positioning.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ RelativePosition
+ |
+
+
+
+ The relative positioning. + |
+ + required + | +
frame_size |
+
+ FrameSize
+ |
+
+
+
+ The size of the frame. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AbsolutePosition
+ |
+
+
+
+ The absolute positioning. + |
+
src/mosaico/positioning/absolute.py
from_region
+
+
+
+ classmethod
+
+
+from_region(
+ position: RegionPosition, frame_size: FrameSize
+) -> AbsolutePosition
+
Creates an absolute positioning from a region positioning.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ RegionPosition
+ |
+
+
+
+ The region positioning. + |
+ + required + | +
frame_max_width |
+ + | +
+
+
+ The maximum width of the frame. + |
+ + required + | +
frame_max_height |
+ + | +
+
+
+ The maximum height of the frame. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AbsolutePosition
+ |
+
+
+
+ The absolute positioning. + |
+
src/mosaico/positioning/absolute.py
PositionType
+
+
+
+ module-attribute
+
+
+PositionType = Literal['absolute', 'relative', 'region']
+
An enumeration of the different types of positions that can be held in an assets.
+
Position
+
+
+
+ module-attribute
+
+
+Position = Union[
+ AbsolutePosition, RelativePosition, RegionPosition
+]
+
Represents a positioning of an assets in the frame.
+
convert_position_to_absolute
+
+
+convert_position_to_absolute(
+ position: Position, frame_size: FrameSize
+) -> AbsolutePosition
+
Convert a relative position to an absolute position.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ Position
+ |
+
+
+
+ The position to be converted. + |
+ + required + | +
frame_size |
+
+ FrameSize
+ |
+
+
+
+ The size of the frame. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ AbsolutePosition
+ |
+
+
+
+ The converted absolute positioning object. + |
+
src/mosaico/positioning/utils.py
is_region_position
+
+
+Check if the position is a region position.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ Position
+ |
+
+
+
+ The position to be checked. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Whether the position is a region position. + |
+
src/mosaico/positioning/utils.py
is_relative_position
+
+
+Check if the position is a relative position.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ Position
+ |
+
+
+
+ The position to be checked. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Whether the position is a relative position. + |
+
src/mosaico/positioning/utils.py
is_absolute_position
+
+
+Check if the position is an absolute position.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
position |
+
+ Position
+ |
+
+
+
+ The position to be checked. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ bool
+ |
+
+
+
+ Whether the position is an absolute position. + |
+
src/mosaico/positioning/utils.py
RegionX
+
+
+
+ module-attribute
+
+
+RegionX = Literal['left', 'center', 'right']
+
The possible region x-coordinates of the assets.
+
RegionY
+
+
+
+ module-attribute
+
+
+RegionY = Literal['top', 'center', 'bottom']
+
The possible region y-coordinates of the assets.
+
RegionPosition
+
+
+
+ Bases: BaseModel
Represents a region positioning.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['region'] = 'region'
+
The type of positioning. Defaults to "region".
+
x
+
+
+
+ class-attribute
+ instance-attribute
+
+
+x: RegionX = 'center'
+
The region x-coordinate of the assets.
+
y
+
+
+
+ class-attribute
+ instance-attribute
+
+
+y: RegionY = 'center'
+
The region y-coordinate of the assets.
+
from_string
+
+
+
+ classmethod
+
+
+from_string(string: str) -> RegionPosition
+
Create a region position from a string.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
string |
+
+ str
+ |
+
+
+
+ The string to parse. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ RegionPosition
+ |
+
+
+
+ The region position. + |
+
src/mosaico/positioning/region.py
RelativePosition
+
+
+
+ Bases: BaseModel
Represents a relative position.
+ + + + +
type
+
+
+
+ class-attribute
+ instance-attribute
+
+
+type: Literal['relative'] = 'relative'
+
The type of position. Defaults to "relative".
+
x
+
+
+
+ class-attribute
+ instance-attribute
+
+
+x: NonNegativeFloat = 0.5
+
The x-coordinate of the assets.
+
y
+
+
+
+ class-attribute
+ instance-attribute
+
+
+y: NonNegativeFloat = 0.5
+
The y-coordinate of the assets.
+
Scene
+
+
+
+ Bases: BaseModel
Represents a unit of grouped asset references in a timeline.
+ + + + +
title
+
+
+
+ class-attribute
+ instance-attribute
+
+
+title: str | None = None
+
An optional title of the scene.
+
description
+
+
+
+ class-attribute
+ instance-attribute
+
+
+description: str | None = None
+
An optional description of the scene.
+
asset_references
+
+
+
+ class-attribute
+ instance-attribute
+
+
+asset_references: list[AssetReference] = Field(
+ default_factory=list
+)
+
A list of assets associated with the scene.
+
start_time
+
+
+
+ property
+
+
+start_time: float
+
The start time of the scene in seconds.
+
end_time
+
+
+
+ property
+
+
+end_time: float
+
The end time of the scene in seconds.
+
duration
+
+
+
+ property
+
+
+duration: float
+
The duration of the scene in seconds.
+
has_audio
+
+
+
+ property
+
+
+has_audio: bool
+
Check if the scene has an audio asset.
+
has_subtitles
+
+
+
+ property
+
+
+has_subtitles: bool
+
Check if the scene has a subtitle asset.
+
from_dict
+
+
+
+ classmethod
+
+
+Create a scene from a dictionary.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ Mapping[str, Any]
+ |
+
+
+
+ The dictionary data. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Scene
+ |
+
+
+
+ The scene. + |
+
src/mosaico/scene.py
add_asset_references
+
+
+add_asset_references(
+ references: AssetReference | Sequence[AssetReference],
+) -> Scene
+
Add asset references to the scene.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
references |
+
+ AssetReference | Sequence[AssetReference]
+ |
+
+
+
+ The asset references to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Scene
+ |
+
+
+
+ The scene. + |
+
src/mosaico/scene.py
remove_references_by_asset_id
+
+
+Remove asset references by asset ID.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset_id |
+
+ str
+ |
+
+
+
+ The asset ID to remove. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Scene
+ |
+
+
+
+ The scene. + |
+
src/mosaico/scene.py
with_subtitle_params
+
+
+with_subtitle_params(
+ params: TextAssetParams | Mapping[str, Any]
+) -> Scene
+
Add subtitle asset params to the scene.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
params |
+
+ TextAssetParams | Mapping[str, Any]
+ |
+
+
+
+ The subtitle asset params. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Scene
+ |
+
+
+
+ The scene. + |
+
src/mosaico/scene.py
ScriptGenerator
+
+
+
+ Bases: Protocol
A protocol for generating a shooting script from a list of media files.
+This protocol defines the interface for generating a shooting script for a project from a list of media objects.
+The generate
method should be implemented by concrete classes and should fullfill the contract of this protocol
+by returning a shooting script containing the shots generated from the media files.
Concrete implementations of the ScriptGenerator
protocol can be used by the VideoProjectBuilder
class to
+automatically generate a shooting script for a project, avoiding the need of a manually defined timeline.
Note
+This is a runtime checkable protocol, which means isinstance()
and
+issubclass()
checks can be performed against it.
Example:
+class MyScriptGenerator:
+ def generate(self, media: Sequence[Media], **kwargs: Any) -> ShootingScript:
+ # Implement script generation logic here
+ ...
+
+generator: ScriptGenerator = MyScriptGenerator()
+script = generator.generate(my_media_files)
+
generate
+
+
+generate(
+ media: Sequence[Media], **kwargs: Any
+) -> ShootingScript
+
Generate a shooting script from a list of media files.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
media |
+
+ Sequence[Media]
+ |
+
+
+
+ The list of media objects. + |
+ + required + | +
kwargs |
+
+ Any
+ |
+
+
+
+ Additional context for the script generation. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ ShootingScript
+ |
+
+
+
+ The shooting script generated from the media files. + |
+
src/mosaico/script_generators/protocol.py
Shot
+
+
+
+ Bases: BaseModel
A shot for a script.
+ + + + +
number
+
+
+
+ instance-attribute
+
+
+number: PositiveInt
+
The number of the shot.
+
description
+
+
+
+ instance-attribute
+
+
+description: str
+
The description of the shot.
+
start_time
+
+
+
+ instance-attribute
+
+
+start_time: NonNegativeFloat
+
The start time of the shot in seconds.
+
end_time
+
+
+
+ instance-attribute
+
+
+end_time: PositiveFloat
+
The end time of the shot in seconds.
+
subtitle
+
+
+
+ instance-attribute
+
+
+subtitle: str
+
The subtitle for the shot.
+
media_id
+
+
+
+ instance-attribute
+
+
+media_id: str
+
The media reference for the shot.
+
effects
+
+
+
+ class-attribute
+ instance-attribute
+
+
+effects: list[VideoEffectType] = Field(default_factory=list)
+
The effects applied to the shot.
+
duration
+
+
+
+ property
+
+
+duration: float
+
The duration of the shot in seconds.
+
ShootingScript
+
+
+
+ Bases: BaseModel
A shooting script for a video project.
+ + + + +
title
+
+
+
+ instance-attribute
+
+
+title: str
+
The title of the script.
+
description
+
+
+
+ class-attribute
+ instance-attribute
+
+
+description: str | None = None
+
The description of the script.
+
shots
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The shots in the script.
+
duration
+
+
+
+ property
+
+
+duration: float
+
The total duration of the script in seconds.
+
shot_count
+
+
+
+ property
+
+
+shot_count: int
+
The number of shots in the script.
+
ElevenLabsSpeechSynthesizer
+
+
+
+ Bases: BaseModel
Speech synthesizer for ElevenLabs.
+ + + + +
provider
+
+
+
+ class-attribute
+
+
+provider: str = 'elevenlabs'
+
Provider name for ElevenLabs.
+
api_key
+
+
+
+ class-attribute
+ instance-attribute
+
+
+api_key: str | None = None
+
API key for ElevenLabs.
+
voice_id
+
+
+
+ instance-attribute
+
+
+voice_id: str
+
Voice ID for ElevenLabs.
+
voice_stability
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Voice stability for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
+
voice_similarity_boost
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Voice similarity boost for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
+
voice_style
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Voice style for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
+
voice_speaker_boost
+
+
+
+ class-attribute
+ instance-attribute
+
+
+voice_speaker_boost: bool = True
+
Voice speaker boost for the synthesized speech. Default is True.
+
language_code
+
+
+
+ class-attribute
+ instance-attribute
+
+
+language_code: LanguageAlpha2 = Field(
+ default_factory=lambda: LanguageAlpha2("en")
+)
+
Language code of the text to synthesize. If not provided, it defaults to "en".
+Check the ElevenLabs API documentation for the list of supported languages by model. +https://help.elevenlabs.io/hc/en-us/articles/17883183930129-What-models-do-you-offer-and-what-is-the-difference-between-them
+
model
+
+
+
+ class-attribute
+ instance-attribute
+
+
+model: Literal[
+ "eleven_turbo_v2_5",
+ "eleven_turbo_v2",
+ "eleven_multilingual_v2",
+ "eleven_monolingual_v1",
+ "eleven_multilingual_v1",
+] = "eleven_multilingual_v2"
+
Model ID for ElevenLabs.
+
timeout
+
+
+
+ class-attribute
+ instance-attribute
+
+
+timeout: int = 120
+
Timeout for the HTTP request in seconds.
+
synthesize
+
+
+synthesize(
+ texts: Sequence[str],
+ *,
+ audio_params: AudioAssetParams | None = None,
+ **kwargs: Any
+) -> list[AudioAsset]
+
Synthesizes the given texts into audio assets using the ElevenLabs API.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
texts |
+
+ Sequence[str]
+ |
+
+
+
+ List of texts to synthesize. + |
+ + required + | +
audio_params |
+
+ AudioAssetParams | None
+ |
+
+
+
+ Audio parameters for the synthesized audio assets. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[AudioAsset]
+ |
+
+
+
+ List of synthesized audio assets. + |
+
src/mosaico/speech_synthesizers/elevenlabs.py
SpeechSynthesizer
+
+
+
+ Bases: Protocol
Protocol defining the interface for text-to-speech synthesis services.
+The SpeechSynthesizer protocol standardizes how text is converted to speech across +different TTS providers (e.g., Google Cloud TTS, Azure Speech). Implementations +of this protocol handle the specifics of communicating with TTS services and managing +the generated audio assets.
+Implementations should handle:
+Example:
+class MySpeechSynthesizer(SpeechSynthesizer):
+ provider = "my-provider"
+
+ def synthesize(self, texts, audio_params=None):
+ # Implementation details
+ pass
+
+synthesizer = MySpeechSynthesizer()
+audio_assets = synthesizer.synthesize(
+ texts=["Hello world", "Welcome to the demo"],
+ audio_params=AudioAssetParams(volume=0.8)
+)
+
Attributes:
+Name | +Type | +Description | +
---|---|---|
provider |
+
+ str
+ |
+
+
+
+ Identifier for the TTS service provider (e.g., "openai", "assemblyai", "azure"). This should be a unique string that identifies the implementation. + |
+
provider
+
+
+
+ class-attribute
+
+
+provider: str
+
The provider of the speech synthesizer.
+
synthesize
+
+
+synthesize(
+ texts: Sequence[str],
+ *,
+ audio_params: AudioAssetParams | None = None,
+ **kwargs: Any
+) -> list[AudioAsset]
+
Convert a list of texts into synthesized speech audio assets.
+This method handles the conversion of text to speech, managing both the synthesis +process and the creation of audio assets for use in video projects.
+Note
+Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
texts |
+
+ Sequence[str]
+ |
+
+
+
+ List of text strings to be converted to speech. Each string should be properly formatted text ready for synthesis. + |
+ + required + | +
audio_params |
+
+ AudioAssetParams | None
+ |
+
+
+
+ Optional parameters for configuring the output audio assets. If None, default parameters will be used. These parameters affect properties like sample rate, channels, etc. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional provider-specific parameters. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[AudioAsset]
+ |
+
+
+
+ List of audio assets containing the synthesized speech. The returned list will have the same length as the input texts list, with corresponding indices. + |
+
src/mosaico/speech_synthesizers/protocol.py
OpenAISpeechSynthesizer
+
+
+
+ Bases: BaseModel
Speech synthesizer using OpenAI's API.
+ + + + +
provider
+
+
+
+ class-attribute
+
+
+provider: str = 'openai'
+
Provider name for OpenAI.
+
api_key
+
+
+
+ class-attribute
+ instance-attribute
+
+
+api_key: str | None = None
+
API key for OpenAI's API.
+
base_url
+
+
+
+ class-attribute
+ instance-attribute
+
+
+base_url: str | None = None
+
Base URL for OpenAI's API.
+
model
+
+
+
+ class-attribute
+ instance-attribute
+
+
+model: Literal['tts-1', 'tts-1-hd'] = 'tts-1'
+
Model to use for speech synthesis.
+
voice
+
+
+
+ class-attribute
+ instance-attribute
+
+
+voice: Literal[
+ "alloy", "echo", "fable", "onyx", "nova", "shimmer"
+] = "alloy"
+
Voice to use for speech synthesis.
+
speed
+
+
+
+ class-attribute
+ instance-attribute
+
+
+Speed of speech synthesis.
+
timeout
+
+
+
+ class-attribute
+ instance-attribute
+
+
+timeout: PositiveInt = 120
+
Timeout for speech synthesis in seconds.
+
synthesize
+
+
+synthesize(
+ texts: Sequence[str],
+ *,
+ audio_params: AudioAssetParams | None = None,
+ **kwargs: Any
+) -> list[AudioAsset]
+
Synthesize speech from texts using OpenAI's API.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
texts |
+
+ Sequence[str]
+ |
+
+
+
+ Texts to synthesize. + |
+ + required + | +
audio_params |
+
+ AudioAssetParams | None
+ |
+
+
+
+ Parameters for the audio asset. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional parameters for the OpenAI API. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[AudioAsset]
+ |
+
+
+
+ List of audio assets. + |
+
src/mosaico/speech_synthesizers/openai.py
TimelineEvent
+
+
+
+ module-attribute
+
+
+TimelineEvent = AssetReference | Scene
+
A type alias for a timeline event, which can be an asset reference or a scene.
+
VideoProjectConfig
+
+
+
+ Bases: BaseModel
A dictionary representing the configuration of a project.
+ + + + +
title
+
+
+
+ class-attribute
+ instance-attribute
+
+
+title: str = 'Untitled Project'
+
The title of the project. Defaults to "Untitled Project".
+
version
+
+
+
+ class-attribute
+ instance-attribute
+
+
+version: int = 1
+
The version of the project. Defaults to 1.
+
resolution
+
+
+
+ class-attribute
+ instance-attribute
+
+
+The resolution of the project in pixels. Defaults to 1920x1080.
+
fps
+
+
+
+ class-attribute
+ instance-attribute
+
+
+fps: PositiveInt = 30
+
The frames per second of the project. Defaults to 30.
+
VideoProject
+
+
+
+ Bases: BaseModel
Represents a project with various properties and methods to manipulate its data.
+ + + + +
config
+
+
+
+ class-attribute
+ instance-attribute
+
+
+config: VideoProjectConfig = Field(
+ default_factory=VideoProjectConfig
+)
+
The configuration of the project.
+
assets
+
+
+
+ class-attribute
+ instance-attribute
+
+
+A dictionary mapping assets keys to Asset objects.
+
timeline
+
+
+
+ class-attribute
+ instance-attribute
+
+
+timeline: Timeline = Field(default_factory=Timeline)
+
The timeline of assets and scenes of the video.
+
duration
+
+
+
+ property
+
+
+duration: float
+
The total duration of the project in seconds.
+
from_dict
+
+
+
+ classmethod
+
+
+from_dict(data: dict[str, Any]) -> VideoProject
+
Create a Project object from a dictionary.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
data |
+
+ dict[str, Any]
+ |
+
+
+
+ The dictionary containing the project data. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ A Project object instance. + |
+
src/mosaico/video/project.py
from_file
+
+
+
+ classmethod
+
+
+from_file(path: PathLike) -> VideoProject
+
Create a Project object from a YAML file.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
path |
+
+ PathLike
+ |
+
+
+
+ The path to the YAML file. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ A Project object instance. + |
+
src/mosaico/video/project.py
from_script_generator
+
+
+
+ classmethod
+
+
+from_script_generator(
+ script_generator: ScriptGenerator,
+ media: Sequence[Media],
+ *,
+ config: VideoProjectConfig | None = None,
+ **kwargs: Any
+) -> VideoProject
+
Create a Project object from a script generator.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
generator |
+ + | +
+
+
+ The script generator to use. + |
+ + required + | +
media |
+
+ Sequence[Media]
+ |
+
+
+
+ The media files to use. + |
+ + required + | +
config |
+
+ VideoProjectConfig | None
+ |
+
+
+
+ The configuration of the project. + |
+
+ None
+ |
+
kwargs |
+
+ Any
+ |
+
+
+
+ Additional keyword arguments to pass to the script generator. + |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ A Project object instance. + |
+
src/mosaico/video/project.py
to_file
+
+
+Write the Project object to a YAML file.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
path |
+
+ PathLike
+ |
+
+
+
+ The path to the YAML file. + |
+ + required + | +
src/mosaico/video/project.py
add_assets
+
+
+add_assets(assets: AssetInputType) -> VideoProject
+
Add one or more assets to the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
assets |
+
+ AssetInputType
+ |
+
+
+
+ The asset or list of assets to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
add_timeline_events
+
+
+add_timeline_events(
+ events: EventOrEventSequence,
+) -> VideoProject
+
Add one or more events to the timeline.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
events |
+
+ EventOrEventSequence
+ |
+
+
+
+ The event or list of events to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If an asset referenced in the events does not exist in the project. + |
+
src/mosaico/video/project.py
add_narration
+
+
+add_narration(
+ speech_synthesizer: SpeechSynthesizer,
+) -> VideoProject
+
Add narration to subtitles inside Scene objects by generating speech audio from subtitle text.
+Updates other asset timings within each Scene based on generated speech duration.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
speech_synthesizer |
+
+ SpeechSynthesizer
+ |
+
+
+
+ The speech synthesizer to use for generating narration audio + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project with narration added + |
+
src/mosaico/video/project.py
add_captions
+
+
+add_captions(
+ transcription: Transcription,
+ *,
+ max_duration: int = 5,
+ params: TextAssetParams | None = None,
+ scene_index: int | None = None,
+ overwrite: bool = False
+) -> VideoProject
+
Add subtitles to the project from a transcription.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
transcription |
+
+ Transcription
+ |
+
+
+
+ The transcription to add subtitles from. + |
+ + required + | +
max_duration |
+
+ int
+ |
+
+
+
+ The maximum duration of each subtitle. + |
+
+ 5
+ |
+
params |
+
+ TextAssetParams | None
+ |
+
+
+
+ The parameters for the subtitle assets. + |
+
+ None
+ |
+
scene_index |
+
+ int | None
+ |
+
+
+
+ The index of the scene to add the subtitles to. + |
+
+ None
+ |
+
overwrite |
+
+ bool
+ |
+
+
+
+ Whether to overwrite existing subtitles in the scene. + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 |
|
add_captions_from_transcriber
+
+
+add_captions_from_transcriber(
+ audio_transcriber: AudioTranscriber,
+ *,
+ max_duration: int = 5,
+ params: TextAssetParams | None = None,
+ overwrite: bool = False
+) -> VideoProject
+
Add subtitles to the project from audio assets using an audio transcriber.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
audio_transcriber |
+
+ AudioTranscriber
+ |
+
+
+
+ The audio transcriber to use for transcribing audio assets. + |
+ + required + | +
max_duration |
+
+ int
+ |
+
+
+
+ The maximum duration of each subtitle. + |
+
+ 5
+ |
+
params |
+
+ TextAssetParams | None
+ |
+
+
+
+ The parameters for the subtitle assets. + |
+
+ None
+ |
+
overwrite |
+
+ bool
+ |
+
+
+
+ Whether to overwrite existing subtitles in the scene. + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
with_subtitle_params
+
+
+with_subtitle_params(
+ params: TextAssetParams | Mapping[str, Any]
+) -> VideoProject
+
Override the subtitle parameters for the assets in the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
params |
+
+ TextAssetParams | Mapping[str, Any]
+ |
+
+
+
+ The subtitle parameters to set. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
with_title
+
+
+with_title(title: str) -> VideoProject
+
Override the title of the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
title |
+
+ str
+ |
+
+
+
+ The title to set. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
with_version
+
+
+with_version(version: int) -> VideoProject
+
Override the project version.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
version |
+
+ int
+ |
+
+
+
+ The version to set. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
with_fps
+
+
+with_fps(fps: int) -> VideoProject
+
Override the FPS of the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
fps |
+
+ int
+ |
+
+
+
+ The FPS to set. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
with_resolution
+
+
+with_resolution(resolution: FrameSize) -> VideoProject
+
Override the resolution of the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
resolution |
+
+ FrameSize
+ |
+
+
+
+ The resolution to set. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
get_asset
+
+
+Get an asset by its ID.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset_id |
+
+ str
+ |
+
+
+
+ The ID of the asset. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Asset
+ |
+
+
+
+ The Asset object. + |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If the asset is not found in the project assets. + |
+
src/mosaico/video/project.py
get_timeline_event
+
+
+get_timeline_event(index: int) -> TimelineEvent
+
Get a timeline event by its index.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
index |
+
+ int
+ |
+
+
+
+ The index of the timeline event. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ TimelineEvent
+ |
+
+
+
+ The TimelineEvent object. + |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If the index is out of range. + |
+
src/mosaico/video/project.py
remove_asset
+
+
+remove_asset(asset_id: str) -> VideoProject
+
Remove an asset from the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
asset_id |
+
+ str
+ |
+
+
+
+ The ID of the asset to remove. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
remove_timeline_event
+
+
+remove_timeline_event(index: int) -> VideoProject
+
Remove a timeline event from the project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
index |
+
+ int
+ |
+
+
+
+ The index of the timeline event to remove. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ VideoProject
+ |
+
+
+
+ The updated project. + |
+
src/mosaico/video/project.py
render_video
+
+
+render_video(
+ project: VideoProject,
+ output_dir: str | Path,
+ *,
+ overwrite: bool = False
+) -> Path
+
Renders a video based on a project.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
project |
+
+ VideoProject
+ |
+
+
+
+ The project to render. + |
+ + required + | +
output_dir |
+
+ str | Path
+ |
+
+
+
+ The output directory. + |
+ + required + | +
overwrite |
+
+ bool
+ |
+
+
+
+ Whether to overwrite the output file if it already exists. + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Path
+ |
+
+
+
+ The path to the rendered video. + |
+
src/mosaico/video/rendering.py