Multistreaming
Distribute one live program to multiple RTMP or RTMPS destinations.
On this page
Add destinations to a stream, then select them when creating a broadcast. Each destination receives the canonical program and has independent connection state and recovery. Private HLS playback remains available.
Add a destination
Obtain the ingest server URL and separate stream key from the destination platform. This backend helper accepts those credentials from an authorized operator:
import { relay } from './relay.js'
export async function addDestination(
streamId: string, endpoint: string, streamKey: string,
) {
return relay.streams.destinations.create(streamId, {
name: 'External platform',
endpoint,
streamKey,
profile: 'remux',
enabled: true,
})
}The endpoint must be a public RTMP/RTMPS server with an application path, using port 1935, 1936 or 443. Query strings, userinfo and fragments are rejected. Put the stream key in streamKey, not in a combined credential URL.
RelayRTC encrypts saved credentials. Reads return safe metadata rather than the endpoint and key. Preserve STREAMING_DESTINATION_ENCRYPTION_KEY across restarts and backups.
Choose output quality
| Profile | Output |
|---|---|
remux | Copies the canonical H.264/AAC program without another encoding pass |
720p | 1280 × 720, 30 fps, 2.5 Mbit/s video, 128 kbit/s AAC |
1080p | 1920 × 1080, 30 fps, 5 Mbit/s video, 128 kbit/s AAC |
Transcoded profiles preserve aspect ratio with padding. Audio-only inputs remain audio-only; the receiving platform decides whether it accepts them. Upscaling does not add source detail.
Select destinations for a run
import { relay } from './relay.js'
export async function createDistributedEvent(streamId: string, destinationIds: string[]) {
return relay.broadcasts.create({
streamId,
name: 'Distributed town hall',
destinationIds,
})
}Start the returned broadcast using the broadcast workflow. Even an unstarted run keeps its creation snapshot. Renaming, disabling, rotating or deleting a destination affects newly created runs; stop an existing run to disconnect its saved outputs.
Connecting media to a platform does not necessarily publish its event. Finish that platform's preview/go-live controls where required. RelayRTC does not create platform events, manage platform OAuth or relay platform chat.
Monitor and retry
Read broadcasts.getOutputs(broadcastId) for output state, bitrate, observed bytes, dropped frames and safe errors. Failed destinations recover independently; healthy outputs continue.
For a failed output, call broadcasts.outputs.retry(broadcastId, outputId) from an authorized backend. Retry cycles are bounded and have a cooldown; terminal runs cannot retry. Use stable idempotency keys when retrying uncertain command responses.
For address/TLS failures, check public DNS, allowed ports and trusted certificates. For connection or encoder failures, inspect the platform's private ingest dashboard. Do not expose credentials or raw encoder logs to viewers.
Capacity and usage
Defaults allow eight destinations per stream/run, 24 Mbit/s of configured destination bitrate and 20 GB of observed external egress per run. Output slots are separate: HLS occupies one slot, and each external destination occupies another. Increasing a destination limit alone does not add worker capacity.
Destination bytes measure outbound socket bytes, including RTMP overhead, rather than viewer traffic. Transcode seconds measure observed elapsed output time, not CPU-seconds. An external egress limit stops external outputs while preserving the HLS/source program.
See destination REST APIs, Node methods and usage.