# Caption/UMD and Expressions

When you create a caption in a multiview output, you can either create a caption with static text, or you can provide an expression. By default, expressions are updated every 250 milliseconds, as they cause a full re-render of the caption.

### Adding Captions

1. Select the multiview you want to add a caption to in the web UI.
2. Click **Edit Layout**
3. Click **Add Caption** or press the **C** key.

Your caption will be added to the canvas. You can drag it around.

Every caption has the following properties.

<table><thead><tr><th width="208">Property Name</th><th>Description</th></tr></thead><tbody><tr><td>X &#x26; Y</td><td>Sets the location of this caption.</td></tr><tr><td>Pad (LTRB)</td><td>Sets how much padding should be around the text in this caption. (Left, Top, Right, Bottom)</td></tr><tr><td>Text</td><td>If set, the static text that will be displayed in this caption.</td></tr><tr><td>Font</td><td>If set, the custom TTF font to use for this caption. Custom fonts can be added to the configuration file directory for Multiview.</td></tr><tr><td>Expression</td><td>If set, the dynamic text that will be displayed in this caption. <strong>Do not set this AND Text at the same time. Use one or the other.</strong></td></tr><tr><td>Fill RGBA</td><td>The background color of this caption, given as an HTML hex color.</td></tr><tr><td>Font RGBA</td><td>The text color of this caption, given as an HTML hex color.</td></tr><tr><td>Code</td><td>The unique code of this caption. Used for updating this caption from the HTTP API.</td></tr></tbody></table>

<figure><img src="/files/Ebeuot3oK4iuBdGRxPLN" alt=""><figcaption></figcaption></figure>

### Expressions

{% hint style="info" %}
**CAUTION:** Viewports and viewers start from **zero (0)**. The first viewer is viewer0, the second is viewer1, and so on. Same with viewports.
{% endhint %}

<table><thead><tr><th width="128">Category</th><th width="370">Token Pattern</th><th>Description</th></tr></thead><tbody><tr><td><strong>System / Internal</strong></td><td><code>$startuptime$</code></td><td>App start time UTC in HH:mm:ss</td></tr><tr><td></td><td><code>$internal.instancename$</code></td><td>The platform and architecture this instance is running on. For example, `windows_x86_x64`. Includes the hostname.</td></tr><tr><td></td><td><code>$internal.version$</code></td><td>The version of multiview running on this instance.</td></tr><tr><td></td><td><code>$internal.name$</code></td><td>The hostname of the machine.</td></tr><tr><td><strong>Clocks &#x26; Uptime</strong></td><td><code>$clock24$</code></td><td>Local time now (HH:mm:ss), 24-hour time</td></tr><tr><td></td><td><code>$clockutc24$</code></td><td>UTC time now (HH:mm:ss), 24-hour time</td></tr><tr><td></td><td><code>$uptime$</code></td><td>Minutes since startup (to 1 decimal place)</td></tr><tr><td><strong>Per-Viewer Diagnostics</strong></td><td><code>$viewer0.diag.renderavg$</code></td><td>Average time to render a viewer for viewer <em>i</em> in ms</td></tr><tr><td></td><td><code>$viewer0.diag.rendermax$</code></td><td>Max time to render a viewer in ms</td></tr><tr><td></td><td><code>$viewer0.diag.ndiavg$</code></td><td>Avg NDI send wait time ms</td></tr><tr><td></td><td><code>$viewer0.diag.ndimax$</code></td><td>Max NDI send wait time ms</td></tr><tr><td></td><td><code>$viewer0.diag.hxavg$</code></td><td>Avg NDI|HX frame encode time ms</td></tr><tr><td></td><td><code>$viewer0.diag.hxmax$</code></td><td>Max NDI|HX frame encode time msec</td></tr><tr><td></td><td><code>$viewer0.diag.avg$</code></td><td>Average total time to render, encode, and send viewer to NDI</td></tr><tr><td></td><td><code>$viewer0.diag.max$</code></td><td>Maximum total time to render, encode, and send viewer to NDI</td></tr><tr><td><strong>Per-Viewer State</strong></td><td><code>$viewer0.name$</code></td><td>Viewer’s human-readable name</td></tr><tr><td></td><td><code>$viewer0.ndiactive$</code></td><td>“Yes”/“No” if NDI output enabled</td></tr><tr><td></td><td><code>$viewer0.audiosource$</code></td><td>Audio source name or <code>(None)</code></td></tr><tr><td><strong>Per-Viewport State</strong></td><td><code>$viewer0.viewport0.source$</code></td><td>NDI source name or <code>(None)</code></td></tr><tr><td></td><td><code>$viewer0.viewport0.bandwidth$</code></td><td>“Full Bandwidth” / “Proxy Feed”</td></tr><tr><td></td><td><code>$viewer0.viewport0.watchdog$</code></td><td>“Yes” if watchdog timed out, else “No”</td></tr><tr><td></td><td><code>$viewer0.viewport0.audio.channels$</code></td><td>Audio channel count or <code>-</code></td></tr><tr><td></td><td><code>$viewer0.viewport0.audio.samplerate$</code></td><td>Sample rate or <code>-</code></td></tr><tr><td></td><td><code>$viewer0.viewport0.audio.avgdbfs$</code></td><td>Peak dBFS (0.0 format) or <code>-</code></td></tr><tr><td></td><td><code>$viewer0.viewport0.preview$</code></td><td>“Yes”/“No” if preview tally</td></tr><tr><td></td><td><code>$viewer0.viewport0.program$</code></td><td>“Yes”/“No” if program tally</td></tr><tr><td></td><td><code>$viewer0.viewport0.tally$</code></td><td>“Preview”, “Program”, “Preview &#x26; Program”, or “None”</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tractus.gitbook.io/tractus-tools-for-ndi/getting-started/caption-umd-and-expressions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
