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

# Video

> Log and view video data in Pluto

## Logging

You can log video in the following formats:

* [**MP4**](https://en.wikipedia.org/wiki/MP4_file_format) - MPEG-4 Part 14 container format
* [**GIF**](https://en.wikipedia.org/wiki/GIF) - Graphics Interchange Format
* [**WebM**](https://en.wikipedia.org/wiki/WebM) - Open web media format
* [**M4A**](https://en.wikipedia.org/wiki/MPEG-4_Part_14#.m4a) - MPEG-4 Audio format
* [**OGG**](https://en.wikipedia.org/wiki/Ogg) - Free, open container format

To log a video, instantiate the `pluto.Video` class:

```python theme={null}
video = pluto.Video(
    data: Union[str, np.ndarray],
    rate: int | None = 30,
    caption: str | None = None,
    format: str | None = None,
)
pluto.log({"video/file/0-0": video}, step=step)
```

| **Parameter** | **Type**                 | **Description**                                                        |
| ------------- | ------------------------ | ---------------------------------------------------------------------- |
| `data`        | `Union[str, np.ndarray]` | The video data to log. Can be a path to a video file or a NumPy array. |
| `rate`        | `int`                    | The frame rate of the video. Defaults to 30.                           |
| `caption`     | `str`                    | A caption for the video.                                               |
| `format`      | `str`                    | The format of the video. Defaults to `mp4`.                            |

### Examples

#### Logging Videos from File Paths

```python theme={null}
path = "video.mp4"
pluto.log({"video": pluto.Video(path)}, step=step)
```

#### Logging Videos from NumPy Arrays

```python theme={null}
data = np.random.randint(low=0, high=256, size=(10, 3, 112, 112), dtype=np.uint8)
pluto.log({"video": pluto.Video(data)}, step=step)
```

## Viewing

Logged videos appear as playable widgets. Each video card includes standard playback controls (play/pause, seek) and displays the filename and associated run.

<img src="https://mintcdn.com/trainy/Q1p3R0pB-6vWZ8VS/images/pluto/video-widget.png?fit=max&auto=format&n=Q1p3R0pB-6vWZ8VS&q=85&s=79b8c44301f86bc904119e4ce6301f4e" alt="Video widget in the dashboard" width="1974" height="1022" data-path="images/pluto/video-widget.png" />

When comparing multiple runs, video widgets from each run are shown together, making it easy to visually compare generated outputs or training episodes across experiments.

### Step Navigation

If you log videos at multiple training steps, use the step slider below the players to browse through different steps. When multiple video groups are displayed in the same section, their step sliders can be **linked** so that changing the step on one group changes all of them simultaneously. Click the **lock icon** on the step navigator to toggle sync on or off.

### Multi-Sample Logging

If you log a list of videos at the same step under one log name (e.g. `pluto.log({"rollouts": [pluto.Video(a), pluto.Video(b)]}, step=10)`), every video renders inside the same card with a per-cell `◀  i / N  ▶` nav row above the player. The same nav row appears next to the filename in the fullscreen video viewer, and the inline and fullscreen states stay in sync.

<img src="https://mintcdn.com/trainy/FWcnzCTJxbpiSmbB/images/pluto/multi-index-nav-video.png?fit=max&auto=format&n=FWcnzCTJxbpiSmbB&q=85&s=45ff10c5f25ed0d948c81139800702c4" alt="Multi-sample video card with 1/2 nav row" style={{ maxWidth: '60%' }} width="345" height="340" data-path="images/pluto/multi-index-nav-video.png" />

### Fullscreen View

Click the **expand** button on any video card's toolbar to open it in fullscreen. The fullscreen view displays the full multi-run comparison at viewport size. Use arrow keys to navigate between steps.
