# 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="https://4106520823-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fu8sK5xu39P2AP0P0y4Nm%2Fuploads%2FQKlZCbN2LRKL6LQqDokV%2Fimage.png?alt=media&#x26;token=ce4cecfc-6bc6-4983-bff0-a985e894a303" 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>
