INTEGRITY Cloudflare Docs

Simulcast (restream) videos

Simulcasting lets you forward your live stream to third-party platforms such as Twitch, YouTube, Facebook, Twitter, and more. You can simulcast to up to 50 concurrent destinations from each live input. To begin simulcasting, select an input and add one or more Outputs.

Add an Output using the API

Add an Output to start retransmitting live video. You can add or remove Outputs at any time during a broadcast to start and stop retransmitting.

Request
curl -X POST \
--data '{"url": "rtmp://a.rtmp.youtube.com/live2","streamKey": "<redacted>"}' \
-H "Authorization: Bearer <API_TOKEN>" \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/live_inputs/<INPUT_UID>/outputs
Response
{
  "result": {
    "uid": "6f8339ed45fe87daa8e7f0fe4e4ef776",
    "url": "rtmp://a.rtmp.youtube.com/live2",
    "streamKey": "<redacted>"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Control when you start and stop simulcasting

You can enable and disable individual live outputs with either:

This allows you to:

When a live output is disabled, video is not simulcast to the live output, even when actively streaming to the corresponding live input.

By default, all live outputs are enabled.

Enable outputs from the dashboard:

  1. In the Cloudflare dashboard, go to the Live inputs page.

    Go to Live inputs ↗
  2. Select an input from the list.

  3. Under Outputs > Enabled, set the toggle to enabled or disabled.

Manage outputs

Command Method Endpoint
List outputs GET accounts/:account_identifier/stream/live_inputs
Delete outputs DELETE accounts/:account_identifier/stream/live_inputs/:live_input_identifier
List All Outputs Associated With A Specified Live Input GET /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs
Delete An Output DELETE /accounts/{account_id}/stream/live_inputs/{live_input_identifier}/outputs/{output_identifier}

If the associated live input is already retransmitting to this output when you make the DELETE request, that output will be disconnected within 30 seconds.