Run

Modes

icey-server has three operational modes. Each changes what the server does with media and what the browser's role is.

ModeBrowser sendsServer sendsUse case
streamcall controlH.264 + Opusserver-originated media to browser
recordH.264 videocall controlbrowser video captured to disk
relayone source callerencoded relay to viewersbrowser-originated live fanout

Set the mode with --mode or in the config file under media.mode.

Stream Mode

The server captures from a local file, camera, or RTSP URL, encodes H.264 + Opus, and pushes it to every connected browser over WebRTC.

icey-server --mode stream --source /path/to/video.mp4

Each browser peer gets its own capture and encoder pipeline. The server starts sending media as soon as the WebRTC session reaches the Active state.

Config

{
  "media": {
    "mode": "stream",
    "source": "/path/to/video.mp4",
    "loop": true
  }
}
{
  "media": {
    "mode": "stream",
    "source": "/dev/video0",
    "loop": false
  }
}
{
  "media": {
    "mode": "stream",
    "source": "rtsp://192.168.1.100:554/stream1",
    "loop": false
  }
}

Intelligence

Real-time intelligence branches for vision (motion detection, frame sampling) and speech (voice activity detection) currently activate only in stream mode. They run as side pipelines on decoded media and emit events over the WebSocket signalling channel without affecting the transport path.

If you keep intelligence configured in record or relay mode, the server leaves those stages inactive and --doctor reports that as a warning instead of silently pretending they are active.

Configure or disable these stages in media.intelligence. See the config reference.

Switching Modes

Modes are set at startup, not at runtime. To switch modes, restart the server with a different --mode flag or update the config file.

If you are bringing the stack up for the first time, work through the modes in this order:

1

**Stream** with a local file and `--no-turn`

This validates signalling and the server-to-browser media path with the fewest moving parts.

2

**Record**

This validates the browser-to-server media path and recording pipeline.

3

**Relay**

This validates the full bidirectional path: browser sends, server relays, other browsers receive.

4

**Enable TURN**

Once all three modes work on localhost, remove --no-turn and test under real NAT conditions.

That ordering keeps signalling, send path, receive path, relay, and public addressing problems separated instead of mixed together on day one.