Simulcasting
Simulcasting lets you forward your live stream to third-party platforms such as YouTube Live and Facebook Live. 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.
curl -X POST \--data '{"url": "rtmp://a.rtmp.youtube.com/live2","streamKey": "<redacted>"}' \-H "Authorization: Bearer $TOKEN" \https://api.cloudflare.com/client/v4/accounts/$ACCOUNT/stream/live_inputs/$INPUT_UID/outputs
Example response:
{ "result": { "uid": "6f8339ed45fe87daa8e7f0fe4e4ef776", "url": "rtmp://a.rtmp.youtube.com/live2", "streamKey": "<redacted>" }, "success": true, "errors": [], "messages": []
}
Managing outputs
To get a list of outputs, call the /outputs
endpoint:
curl -H "Authorization: Bearer $TOKEN" \ https://api.cloudflare.com/client/v4/accounts/$ACCOUNT/stream/live_inputs/$INPUT_UID/outputs
To delete an output, make a DELETE
request to the /outputs
endpoint with the output id:
curl -X DELETE \ -H "Authorization: Bearer $TOKEN" \https://api.cloudflare.com/client/v4/accounts/$ACCOUNT/stream/live_inputs/$INPUT_UID/outputs/$OUTPUT_UID
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.