Restreaming
A destination pushes a channel, or an input as it arrives, to another platform or to any RTMP, RTMPS or SRT server. A server can have up to 50 destinations. Restream copies need no encoding, so they cost no processing; the bytes you push are billed as bandwidth.
Creating, changing and deleting destinations needs stream:admin. Starting and stopping them needs stream:operate.
Add a destination
Under Destinations, add a destination and fill in:
- Name, for example
YouTube. - Sends: a channel, or an input as received.
- Platform. A preset fills the protocol and the ingest URL. LinkedIn and custom targets need the URL you paste.
- Stream key: the key the platform gives you. For SRT targets, an optional SRT passphrase.
- Quality: the source, or one rendition of the channel's ladder.
- Start automatically: go live on the platform whenever the source goes live.
From the CLI, the key is read from standard input so it never lands in your shell history or process list:
hubfly stream destinations create acme-tv YouTube --platform youtube \
--source channel:sch_main0001 --stream-key-stdin --auto-start
# Paste the YouTube stream key, then press Ctrl-D
hubfly stream destinations create acme-tv "LinkedIn launch" --platform linkedin \
--source channel:sch_main0001 --url "<stream URL from the LinkedIn event>" --stream-key-stdin
hubfly stream destinations list acme-tvPlatforms
| Platform | --platform | Ingest URL | Where to find the stream key |
|---|---|---|---|
| YouTube | youtube | rtmps://a.rtmps.youtube.com:443/live2 | YouTube Studio → Go live → Stream → Stream key |
| Twitch | twitch | rtmps://live.twitch.tv:443/app | Creator Dashboard → Settings → Stream → Primary stream key |
facebook | rtmps://live-api-s.facebook.com:443/rtmp/ | Live Producer → Streaming software → Stream key | |
| Kick | kick | rtmps://fa723fc1b171.global-contribute.live-video.net:443/app | Kick Dashboard → Settings → Stream URL & Key |
| X | x | rtmps://va.pscp.tv:443/x | Media Studio → Producer → Sources |
linkedin | Each event has its own URL: pass it with --url | The LinkedIn event → Streaming software: copy the stream URL and the stream key | |
| Custom | custom | Any rtmp://, rtmps:// or srt:// URL, with --url | The key (or stream name) the receiving server expects |
SRT destinations connect as a caller and send MPEG-TS. Put the key in the stream key field, never in the URL.
Platforms expect H.264 video with AAC audio and regular keyframes. For a 1080p30 restream, send H.264 high at 6,000 kbps CBR, AAC at 160 kbps and 48 kHz, with a keyframe every 2 seconds. See OBS and encoders.
Source and quality
- A channel (
--source channel:<id>) sends what the channel plays: its input, mixer or playlist. - An input (
--source input:<id>) sends the stream exactly as the encoder publishes it, without a channel. - Rendition.
sourcesends the stream as received. A channel with a ladder can also send one of its renditions, such as720p, to a platform that limits bitrate. A destination fed by an input can only sendsource.
A rendition is encoded once for the channel, whoever uses it. Sending it to a destination adds no processing.
Start and stop
With Start automatically (autoStart), a destination starts whenever its source goes live and stops when it ends. Without it, start and stop it yourself:
- the Start and Stop buttons under Destinations;
hubfly stream destinations start|stoporhubfly stream control --destination-start;- the
destination.startanddestination.stopcontrol ops; - a schedule, to go live on a platform at a set time.
hubfly stream destinations start acme-tv sds_yt000001
hubfly stream destinations stop acme-tv sds_yt000001Which destinations you started survives a restart or an upgrade of the media node. A disabled destination stays stopped.
| State | Dashboard | Meaning |
|---|---|---|
connected | Sending | The platform accepted the stream. |
connecting | Connecting | Opening the connection. |
retrying | Retrying | The last attempt failed; the next one is scheduled. |
stopped | Stopped | Not started, or the source is not live. |
error | Failed | The destination cannot send. last_error in the live status says why. |
disabled | Disabled | Configured but turned off. |
Reconnects and events
While the source is live, a destination that fails or drops reconnects after 1, 2, 5, 10, 30 and then every 60 seconds. Each failure sends a destination.failed event with the error and the delay before the next attempt (retry_in_ms); a successful connection sends destination.connected, and stopping sends destination.stopped. Receive them with webhooks or follow them with hubfly stream events acme-tv.
When a destination fails repeatedly, the Dashboard raises an alert on the server. It clears when the destination connects again.
Stream keys
- Destination stream keys and SRT passphrases are write-only. They are stored encrypted and sent only to the media node. The API returns
streamKeyHint(the last characters of the key) andhasSrtPassphrase, never the key. - To change a key, send a new
streamKeyon update. Omit it to keep the current one. - Keys never appear in logs or events.
Bandwidth and billing
Bytes pushed to destinations count as bandwidth, at $0.004 per GB after the free 50 GB a month. They also count toward the server's speed, together with viewers. See pricing and limits.
For example, OBS sending 6 Mbps to YouTube, Twitch and Kick for 60 hours a month pushes 3 × 6 Mbps × 60 h = 486 GB. After the free 50 GB, 436 GB cost $1.74. The 18 Mbps fit in the free 25 Mbps of speed and the copies need no processing, so the month costs about $1.74.
Allowed targets
- Protocols:
rtmp,rtmpsandsrt. - The media node connects only to public addresses. Private, loopback, link-local, carrier-grade NAT, multicast and cloud metadata addresses are refused, after DNS resolution, and the checked address is used for the whole connection.
- Well-known internal service ports, such as 22, 25, 53, 3306, 5432 and 6379, are refused.
Restream to your own server
custom platform with its RTMP, RTMPS or SRT URL.With the API
Create a destination with POST …/stream/destinations/create. The platform preset fills protocol and url:
STREAM=https://api.hubfly.space/api/v1/projects/$PROJECT_ID/managed/instances/$INSTANCE_ID/stream
curl -X POST "$STREAM/destinations/create" \
-H "Authorization: Bearer $HUBFLY_TOKEN" -H "Content-Type: application/json" \
-d '{
"name": "YouTube",
"platform": "youtube",
"source": {"type": "channel", "ref": "sch_main0001"},
"rendition": "source",
"streamKey": "<your YouTube stream key>",
"autoStart": true
}'Start or stop it with a control request. The id (8–64 characters) makes the request safe to retry for 10 minutes:
curl -X POST "$STREAM/control" \
-H "Authorization: Bearer $HUBFLY_TOKEN" -H "Content-Type: application/json" \
-d '{"id": "ctl_ytstart0001", "ops": [{"op": "destination.start", "destination": "sds_yt000001"}]}'See Destinations and Live control and usage in the API reference.