Configuration
Project and scene settings.
Precedence, from strongest to weakest: command-line flags, the @k.scene decorator, the [scene] table of kinemo.toml, built-in defaults.
kinemo.toml#
Found by walking up from the current directory; the directory that contains it is the project root. kinemo new writes this one:
# kinemo project configuration
[scene]
fps = 60
size = "1080p"
theme = "dark"
[render]
out = "out"
[lints]
allow = []
Keys#
| Key | Type | Default | Effect |
|---|---|---|---|
[scene] size |
str | tuple[int, int] |
"1080p" |
Output size: a preset name ("1080p", "4k", "vertical", ...) or (width, height) in pixels. |
[scene] fps |
float |
60 |
Frames per second of the final render. |
[scene] background |
ColorLike | None |
None |
Background color; None uses the theme's bg. |
[scene] seed |
int |
0 |
Seed for random and numpy.random during the build, so scenes are reproducible. |
[scene] tail |
float |
0.5 |
Seconds added after the last animation ends. |
[scene] theme |
Theme | str | None |
None |
A k.Theme or the name of one in k.themes ("dark", "light", "blueprint"). |
[scene] camera |
str |
"2d" |
"2d" or "3d". |
[scene] platform |
Literal['reels', 'tiktok', 'shorts'] | None |
None |
The app a vertical video is made for ("reels", "tiktok", "shorts"): the zones its buttons and captions cover narrow the safe area. Ignored for frames that are not vertical. |
[scene] questions |
Literal['quiz', 'answers'] |
"quiz" |
What a lesson's video does at each s.ask question: "quiz" shows the question and its answers, gives think= seconds to pause, then reveals the right answer; "answers" plays on along the correct path. kinemo render --questions overrides it. |
[presets.<name>] * |
table | {} |
Named scene defaults (the keys of [scene]), chosen with @k.scene(preset="<name>"): decorator > preset > [scene] > defaults. For defaults in Python, k.scene_preset(...). |
[render] * |
table | {} |
Read into ProjectConfig.render; the CLI does not use it yet. The output directory is set with --out (default out). |
[lints] allow |
list[str] |
[] |
Lint codes allowed in the whole project (see diagnostics). |
[tts] provider |
str |
None |
Text-to-speech provider for s.voice. Without one, s.voice is silent with an estimated duration and lint W1401 is reported. "command" runs [tts] command. |
[tts] command |
list[str] |
[] |
Command of the command provider, run from the project root for each line: {text_file}, {out} and {voice} are replaced. With {lines_file} instead (a JSON list of {text, out, voice}), it runs once for every line. A string is split like a shell command. |
[tts] on_build |
str |
None |
"synthesize": a build makes the audio of lines that have none; "estimate": they stay estimated (W1405) until kinemo voice or kinemo render makes them. Unset: estimate for the command provider, synthesize for the others. kinemo check always estimates. |
[tts] wpm |
float |
150.0 |
Speaking rate (words per minute) of the silent estimate used when a line has no audio. |
[audio] loudness |
float |
None |
Integrated loudness of rendered audio, in LUFS (e.g. -16). Without it, the mix keeps its level. |
[audio] trim_silence |
bool |
False |
Cut the silence around each narration line when it is measured. |
[align] model |
str |
"base.en" |
Speech model that aligns words to narration audio, with pip install "kinemo[align]". |
[cache] dir |
str |
".kinemo-cache" |
Cache directory (generated audio, ...), relative to the project root. |
[editor] command |
str |
"vscode" |
Editor the preview opens on source links: vscode, vscode-insiders, cursor, windsurf, zed, idea, pycharm or sublime (opened by URL), or a command that kinemo dev runs with {file} and {line} replaced, such as emacsclient -n +{line} {file}. Read when kinemo dev starts. |
[python] workers_threshold |
float |
2.0 |
Seconds of k.python computation above which a worker pool is used. |
[python] paths |
list[str] |
[] |
Folders of the project (relative to its root) that scene files import from, such as a shared lib/ of components. kinemo dev reloads modules anywhere in the project. |
@k.scene options#
@k.scene(size="vertical", fps=30, tail=1.0, theme="light")
def intro(s: k.Scene): ...
| Option | Type | Default | Effect | Where |
|---|---|---|---|---|
size |
str | tuple[int, int] |
"1080p" |
Output size: a preset name ("1080p", "4k", "vertical", ...) or (width, height) in pixels. |
also [scene] |
fps |
float |
60 |
Frames per second of the final render. | also [scene] |
background |
ColorLike | None |
None |
Background color; None uses the theme's bg. |
also [scene] |
seed |
int |
0 |
Seed for random and numpy.random during the build, so scenes are reproducible. |
also [scene] |
tail |
float |
0.5 |
Seconds added after the last animation ends. | also [scene] |
theme |
Theme | str | None |
None |
A k.Theme or the name of one in k.themes ("dark", "light", "blueprint"). |
also [scene] |
camera |
str |
"2d" |
"2d" or "3d". |
also [scene] |
params |
dict[str, Param] | None |
None |
Scene parameters (k.Int, k.Float, k.Bool, k.Choice, k.Str), passed to the function by name. |
decorator only |
name |
str | None |
None |
Scene name used by --scene; defaults to the function name. |
decorator only |
preset |
str | None |
None |
Name of a [presets.<name>] table of kinemo.toml whose values this scene starts from. |
decorator only |
platform |
Literal['reels', 'tiktok', 'shorts'] | None |
None |
The app a vertical video is made for ("reels", "tiktok", "shorts"): the zones its buttons and captions cover narrow the safe area. Ignored for frames that are not vertical. |
also [scene] |
questions |
Literal['quiz', 'answers'] |
"quiz" |
What a lesson's video does at each s.ask question: "quiz" shows the question and its answers, gives think= seconds to pause, then reveals the right answer; "answers" plays on along the correct path. kinemo render --questions overrides it. |
also [scene] |
See k.scene and k.SceneDef.
Sizes#
The frame always has 9 units on its shorter side; the longer side follows the aspect ratio. The origin is the center and y points up.
| Preset | Pixels | Frame units | Draft pixels |
|---|---|---|---|
"720p" |
1280 × 720 | 16 × 9 | 960 × 540 |
"1080p" |
1920 × 1080 | 16 × 9 | 960 × 540 |
"4k" |
3840 × 2160 | 16 × 9 | 960 × 540 |
"square" |
1080 × 1080 | 9 × 9 | 540 × 540 |
"vertical" |
1080 × 1920 | 9 × 16 | 540 × 960 |
Any (width, height) tuple is also accepted.
Quality presets#
| Preset | Resolution | Frame rate | Used by |
|---|---|---|---|
draft |
shorter side scaled down to 540 px (never up), even sizes | the scene's fps, at most 30 | kinemo dev, kinemo snap (default) |
final |
the scene's size | the scene's fps | kinemo render (default) |
Choose with --quality draft|final on kinemo snap and kinemo render.