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

# Enable Live DVR and Seek for Red5 Pro Broadcasts

> Let viewers seek and rewind during live broadcasts with Red5 Pro DVR. Covers hlsconfig.xml settings, NFS cluster setup, and storage sizing guidance.

Live DVR lets viewers seek backward and rewind during an ongoing live broadcast. Instead of only seeing what is happening right now, a viewer can pause and rewind to an earlier point in the stream without the broadcast stopping for others. Enabling this feature requires server-side configuration to retain HLS segments rather than discarding them as they age, and client-side initialization to present playback controls that reference those retained segments.

## How Live DVR works

Red5 Pro generates an HLS playlist alongside the live stream. In a standard live configuration, old segments are removed from the playlist as new ones arrive, so the playlist only ever describes the current live window. When DVR is enabled, the server retains all segments and maintains a growing playlist from the start of the broadcast. The subscriber's player loads this full playlist and can seek to any point within it.

## Server configuration

All DVR settings are in `conf/hlsconfig.xml` in your Red5 Pro installation directory. You must restart Red5 Pro after making changes to this file.

### Set the output format

The `outputFormat` property controls the container format used for HLS segments. The default is `TS` (MPEG-2 Transport Stream), which produces a `.m3u8` manifest alongside `.ts` segment files. You can also set it to `FMP4` to produce fragmented MP4 segments.

```xml conf/hlsconfig.xml theme={null}
<property name="outputFormat" value="TS"/>
```

For DVR purposes, `TS` is the most broadly compatible format and is recommended unless you have a specific reason to use FMP4.

### Enable DVR playlist retention

By default, the server discards older segments. Set `dvrPlaylist` to `true` to retain all segments from the start of the broadcast:

```xml conf/hlsconfig.xml theme={null}
<property name="dvrPlaylist" value="true"/>
```

With both properties set, your `hlsconfig.xml` changes look like this in context:

```xml conf/hlsconfig.xml theme={null}
<!-- Output format for HLS segments: TS or FMP4 -->
<property name="outputFormat" value="TS"/>

<!-- Retain all segments to enable DVR seeking -->
<property name="dvrPlaylist" value="true"/>
```

Restart Red5 Pro after saving the file.

## Client-side requirements

Your subscriber client must initialize the player in DVR mode to present seek controls. The specifics depend on the Red5 Pro WebRTC SDK version you are using. Refer to the [DVR API development documentation](https://www.red5.net/docs/red5-pro/development/api/dvr-api/) for the SDK initialization options required to enable seek controls on the client.

<Note>
  The player must be able to load and parse the full DVR playlist. For long broadcasts, this playlist grows large. Test with your target player to ensure it handles large manifests without performance issues.
</Note>

## DVR with Stream Manager clustering

In a Stream Manager cluster, the DVR stream segments are written to the Transcoder node's local disk by default. If subscribers can land on any edge node in your cluster, the segments must be accessible from a shared location rather than a single node's disk. The standard solution is an NFS (Network File System) mount that all relevant nodes write to and read from.

### Architecture

<CardGroup cols={3}>
  <Card title="NFS server" icon="hard-drive">
    A dedicated storage-optimized server that hosts the shared filesystem. All HLS segment files are written here.
  </Card>

  <Card title="Nginx web server" icon="globe">
    Serves the HLS segment files and manifest over HTTP so that subscriber clients can fetch them. Mounts the NFS share as its document root.
  </Card>

  <Card title="Stream Manager cluster" icon="network">
    Transcoder nodes write segments directly to the NFS mount at `/usr/local/red5pro/webapps/live/streams`. Origin, edge, and relay nodes use a standard image.
  </Card>
</CardGroup>

### Step 1: Set up the NFS server

<Steps>
  <Step title="Provision the NFS host">
    Create a storage-optimized server with sufficient disk space. See the storage sizing guidance below to choose the right size.
  </Step>

  <Step title="Install the NFS kernel server">
    ```bash theme={null}
    sudo apt update
    sudo apt install nfs-kernel-server
    mkdir /home/nfs
    sudo chown nobody:nogroup /home/nfs
    sudo chmod 777 /home/nfs
    ```
  </Step>

  <Step title="Configure the export">
    Add the following line to `/etc/exports`:

    ```
    /home/nfs *(rw,sync,no_subtree_check)
    ```

    Then apply the export and restart the NFS service:

    ```bash theme={null}
    sudo exportfs -a
    sudo systemctl restart nfs-kernel-server
    ```
  </Step>

  <Step title="Assign a static address">
    Assign a floating IP or static IP to the NFS server and create a DNS A record for it — for example, `my-nfs.example.com`. Using a DNS name rather than an IP makes it easier to update the mount configuration if the server changes.
  </Step>
</Steps>

### Step 2: Set up the Nginx web server

<Steps>
  <Step title="Provision the Nginx host">
    Create a basic server (80 GB disk is sufficient for the OS; the actual segment data lives on the NFS share).
  </Step>

  <Step title="Install NFS client and Nginx">
    ```bash theme={null}
    sudo apt update
    sudo apt install nfs-common nginx
    mkdir /home/nfs
    ```
  </Step>

  <Step title="Mount the NFS share">
    ```bash theme={null}
    sudo mount my-nfs.example.com:/home/nfs /home/nfs
    ```

    Verify the mount:

    ```bash theme={null}
    df -h
    ```

    You should see the NFS share listed.
  </Step>

  <Step title="Configure persistent mount at boot">
    Add the following line to `/etc/fstab`:

    ```
    my-nfs.example.com:/home/nfs /home/nfs nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
    ```

    Reboot to confirm the mount survives a restart.
  </Step>

  <Step title="Configure Nginx to serve HLS files">
    Edit `/etc/nginx/sites-available/default`:

    ```nginx /etc/nginx/sites-available/default theme={null}
    server {
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name _;

        location / {
            autoindex on;
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            root /home/nfs;
            add_header Cache-Control no-cache;
        }
    }
    ```

    Restart Nginx:

    ```bash theme={null}
    sudo systemctl restart nginx
    ```
  </Step>

  <Step title="Create a DNS record for Nginx">
    Create a DNS A record pointing to your Nginx server's IP — for example, `media.example.com`.
  </Step>
</Steps>

### Step 3: Prepare the Transcoder node image

The Transcoder nodes in your Stream Manager cluster need the NFS share mounted at the Red5 Pro streams directory so that recorded segments are written to shared storage.

<Steps>
  <Step title="Create a base droplet from the standard node image">
    Start from your regular origin/edge/relay node snapshot.
  </Step>

  <Step title="Install the NFS client">
    ```bash theme={null}
    sudo apt update
    sudo apt install nfs-common
    ```
  </Step>

  <Step title="Mount the NFS share at the streams directory">
    ```bash theme={null}
    sudo mount my-nfs.example.com:/home/nfs /usr/local/red5pro/webapps/live/streams
    ```

    Verify the mount:

    ```bash theme={null}
    df -h
    ls -lo /usr/local/red5pro/webapps/live/streams
    ```
  </Step>

  <Step title="Enable stream recording in hlsconfig.xml">
    Edit `/usr/local/red5pro/conf/hlsconfig.xml` and set both properties:

    ```xml conf/hlsconfig.xml theme={null}
    <property name="forceVODRecord" value="true"/>
    <property name="dvrPlaylist" value="true"/>
    ```
  </Step>

  <Step title="Snapshot the droplet">
    Create a snapshot/image from this configured droplet. This is the image you will assign to the Transcoder role in your launch configuration.
  </Step>
</Steps>

### Step 4: Create the launch configuration

Reference both images in your Stream Manager launch configuration — the standard image for origin, edge, and relay roles, and the Transcoder image for the transcoder role. Use a CPU-optimized instance type for Transcoder nodes.

```json launch configuration theme={null}
{
  "launchconfig": {
    "name": "origin-edge-relay-transcoder-dvr",
    "description": "Cluster with DVR-enabled transcoder nodes writing to NFS",
    "version": "0.0.3",
    "image": "node-origin-edge-relay-image",
    "targets": {
      "target": [
        {
          "role": "origin",
          "connectionCapacity": 30.0,
          "instanceType": "c-4"
        },
        {
          "role": "edge",
          "connectionCapacity": 300.0,
          "instanceType": "c-4"
        },
        {
          "role": "relay",
          "connectionCapacity": 40.0,
          "instanceType": "c-4"
        },
        {
          "role": "transcoder",
          "connectionCapacity": 20.0,
          "image": "node-transcoder-nfs-image",
          "instanceType": "c-8"
        }
      ]
    }
  }
}
```

## Recording streams with forceVODRecord

The `forceVODRecord` property in `conf/hlsconfig.xml` instructs Red5 Pro to record every stream as a VOD file in addition to serving it live. Enable it on Transcoder nodes when you want persistent recordings written to shared storage:

```xml conf/hlsconfig.xml theme={null}
<property name="forceVODRecord" value="true"/>
```

With `forceVODRecord` enabled, completed recordings are accessible at the Nginx server URL after the stream ends.

## Storage sizing

Disk capacity on your NFS server determines how many streams you can record simultaneously and for how long. Use the following estimates as a starting point:

| Stream quality | Approximate bitrate | Storage per hour |
| -------------- | ------------------- | ---------------- |
| 720p           | 4.5 Mbit/s          | \~2 GB           |
| 1080p          | 8 Mbit/s            | \~3.6 GB         |

**Network throughput:** A standard NFS server with a 2 Gbit/s network connection can sustain approximately 15 simultaneous 720p streams (15 × 4.5 Mbit/s = 67.5 Mbit/s, well within the limit).

**Transcoder node capacity:** A single Transcoder node on an 8-vCPU CPU-optimized instance can handle approximately 5 concurrent streams. Monitor CPU, memory, and network on both the Transcoder nodes and the NFS server after deployment to confirm actual capacity.

<Tip>
  Start with the smallest storage-optimized NFS instance that fits your expected recording volume, then resize as you measure actual usage. It is easier to expand storage than to predict it accurately before a deployment.
</Tip>

<Info>
  For AWS deployments, you can use Amazon EFS (Elastic File System) as the NFS backend instead of a self-managed NFS server. EFS scales storage automatically and eliminates the need to provision a dedicated NFS host. See the [AWS EFS integration guide](https://www.red5.net/docs/installation/auto-aws/autoscaleawsefssupport/#install-the-nfs-client) for setup details.
</Info>
