> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decktalk.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Every DeckTalk tuning field with its type, its default, and the three places you can set it.

Tuning is everything about *how* DeckTalk renders that does not change from one
presentation to the next. It comes from three layers, and each layer overrides the one
before it.

1. The defaults on this page.
2. A table of the same name in the project's `decktalk.toml`. For example, `[video]` with `preset = "veryfast"` changes the x264 preset for that project.
3. An environment variable named `DECKTALK_<SECTION>_<FIELD>`. For example, `DECKTALK_VIDEO_PRESET=veryfast` changes it for one shell. A list field such as `probe_delays` takes comma-separated values.

A few command-line flags override all three for a single run: `--preset`, `--crf`,
`--settle`, and `--model`.

Content that changes per presentation is the project document, not tuning. Sections, the
voice, mix levels, and soundscape prompts live in the same file under their own tables,
and [the project file](/reference/decktalk-toml) describes them. Secrets live only in `.env`.

<Tip>You rarely need this page. The scaffold builds with every default. Reach for `[video]`
when drafts feel slow, and for `[verify]` when a deliberately subtle reveal fails the cue
check.</Tip>

## `[video]`

Frame size and encoding of every recording and of the final mp4. Environment variables start with `DECKTALK_VIDEO_`.

| Field           | Type  | Default      | Notes                                                                                  |
| --------------- | ----- | ------------ | -------------------------------------------------------------------------------------- |
| `width`         | `int` | `1920`       |                                                                                        |
| `height`        | `int` | `1080`       |                                                                                        |
| `fps`           | `int` | `25`         | Chromium records at 25 fps, so 25 avoids a pulldown that duplicates every sixth frame. |
| `preset`        | `str` | `'medium'`   | x264 preset; veryfast for drafts                                                       |
| `crf`           | `int` | `18`         |                                                                                        |
| `audio_bitrate` | `str` | `'192k'`     |                                                                                        |
| `sample_rate`   | `int` | `48000`      | The video delivery rate, so every audio input is resampled once on the way in.         |
| `channels`      | `int` | `2`          |                                                                                        |
| `slate_color`   | `str` | `'0x0e1116'` | plain frame when a slate cannot be rendered                                            |

## `[narration]`

How the script is turned into audio. Environment variables start with `DECKTALK_NARRATION_`.

| Field                     | Type    | Default                    | Notes                                                   |
| ------------------------- | ------- | -------------------------- | ------------------------------------------------------- |
| `model`                   | `str`   | `'eleven_multilingual_v2'` |                                                         |
| `output_format`           | `str`   | `'mp3_44100_128'`          |                                                         |
| `mp3_bitrate`             | `str`   | `'128k'`                   |                                                         |
| `words_per_minute`        | `int`   | `140`                      | pacing estimate shown in tables                         |
| `silent_words_per_minute` | `int`   | `150`                      | --silent placeholder pacing                             |
| `lead_break_seconds`      | `float` | `0.7`                      | opens the first spoken section                          |
| `direction_break_seconds` | `float` | `0.7`                      | pause where a bracketed direction sat                   |
| `tail_break_seconds`      | `float` | `0.35`                     | requested at the end of every section                   |
| `min_tail_seconds`        | `float` | `0.35`                     | guaranteed silence after the last word                  |
| `tail_slack_seconds`      | `float` | `0.05`                     | extra padding added when the tail is short              |
| `context_chars`           | `int`   | `1500`                     | previous\_text / next\_text sent for prosody continuity |
| `timeout_seconds`         | `int`   | `180`                      |                                                         |

## `[record]`

Headless Chromium recording. Environment variables start with `DECKTALK_RECORD_`.

| Field              | Type    | Default   | Notes                                                      |
| ------------------ | ------- | --------- | ---------------------------------------------------------- |
| `settle_seconds`   | `float` | `0.5`     | after load, before narration t=0                           |
| `min_lead_seconds` | `float` | `1.5`     | t=0 never comes sooner than this after the recorder starts |
| `color_scheme`     | `str`   | `'light'` |                                                            |
| `shot_settle_ms`   | `int`   | `400`     | wait before a review screenshot                            |

## `[align]`

Finding narration t=0 in a recording, and the recording sanity check. Environment variables start with `DECKTALK_ALIGN_`.

| Field                          | Type    | Default | Notes                                      |
| ------------------------------ | ------- | ------- | ------------------------------------------ |
| `scan_seconds`                 | `float` | `4.0`   |                                            |
| `fallback_first_paint_seconds` | `float` | `1.1`   |                                            |
| `magenta_luma_min`             | `float` | `70`    |                                            |
| `magenta_luma_max`             | `float` | `140`   |                                            |
| `magenta_chroma_min`           | `float` | `165`   |                                            |
| `painted_ymax`                 | `float` | `60`    | something is drawn                         |
| `painted_yavg_max`             | `float` | `120`   | and it is not a white flash                |
| `black_ymax`                   | `float` | `40`    | check: a frame darker than this is "black" |
| `truncated_slack_seconds`      | `float` | `0.5`   |                                            |

## `[audio]`

Mix mechanics. Levels are per project (decktalk.toml \[mix]). Environment variables start with `DECKTALK_AUDIO_`.

| Field                       | Type    | Default | Notes |
| --------------------------- | ------- | ------- | ----- |
| `duck_ramp_seconds`         | `float` | `0.5`   |       |
| `ambience_ramp_seconds`     | `float` | `1.0`   |       |
| `ambience_pad_seconds`      | `float` | `0.5`   |       |
| `marker_mute_ramp_seconds`  | `float` | `0.04`  |       |
| `marker_boost_ramp_seconds` | `float` | `0.3`   |       |

## `[verify]`

Checks on the assembled mp4. Environment variables start with `DECKTALK_VERIFY_`.

| Field                 | Type                | Default      | Notes                                                                                  |
| --------------------- | ------------------- | ------------ | -------------------------------------------------------------------------------------- |
| `after_dip_seconds`   | `float`             | `0.2`        |                                                                                        |
| `lead_seconds`        | `float`             | `0.1`        | the reference frame sits this long before the cue                                      |
| `probe_delays`        | `tuple[float, ...]` | `(0.7, 1.5)` | seconds after the cue; the later one catches slow reveals                              |
| `diff_level`          | `int`               | `40`         | luma steps a pixel must change to count                                                |
| `min_changed_percent` | `float`             | `0.1`        | share of the frame the best probe must change                                          |
| `min_margin_percent`  | `float`             | `0.1`        | and by how much it must beat the control span                                          |
| `onset_percent`       | `float`             | `0.002`      | A few pixels mark where a reveal begins, once they clear the pre-cue floor.            |
| `onset_diff_level`    | `int`               | `12`         | Luma steps for the onset scan only, so a fade or a low-contrast panel registers early. |
| `max_offset_frames`   | `int`               | `2`          | Frames the first changed frame may sit from the cue before the check fails.            |
| `visible_ymax`        | `float`             | `60`         |                                                                                        |
| `probe_width`         | `int`               | `480`        |                                                                                        |
| `probe_height`        | `int`               | `270`        |                                                                                        |

## `[elevenlabs]`

Environment variables start with `DECKTALK_ELEVENLABS_`.

| Field                       | Type    | Default                          | Notes |
| --------------------------- | ------- | -------------------------------- | ----- |
| `api_base`                  | `str`   | `'https://api.elevenlabs.io/v1'` |       |
| `sound_model`               | `str`   | `'eleven_text_to_sound_v2'`      |       |
| `music_model`               | `str`   | `'music_v2'`                     |       |
| `music_bitrate`             | `str`   | `'192k'`                         |       |
| `max_music_chunk_seconds`   | `int`   | `300`                            |       |
| `music_crossfade_seconds`   | `int`   | `2`                              |       |
| `ambience_seconds`          | `float` | `25.0`                           |       |
| `ambience_prompt_influence` | `float` | `0.3`                            |       |
| `sfx_seconds`               | `float` | `0.5`                            |       |
| `sfx_prompt_influence`      | `float` | `0.5`                            |       |
| `timeout_seconds`           | `int`   | `600`                            |       |
