Hubfly spaceDocs
Console

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:

bash
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-tv

Platforms

Platform--platformIngest URLWhere to find the stream key
YouTubeyoutubertmps://a.rtmps.youtube.com:443/live2YouTube Studio → Go live → Stream → Stream key
Twitchtwitchrtmps://live.twitch.tv:443/appCreator Dashboard → Settings → Stream → Primary stream key
Facebookfacebookrtmps://live-api-s.facebook.com:443/rtmp/Live Producer → Streaming software → Stream key
Kickkickrtmps://fa723fc1b171.global-contribute.live-video.net:443/appKick Dashboard → Settings → Stream URL & Key
Xxrtmps://va.pscp.tv:443/xMedia Studio → Producer → Sources
LinkedInlinkedinEach event has its own URL: pass it with --urlThe LinkedIn event → Streaming software: copy the stream URL and the stream key
CustomcustomAny rtmp://, rtmps:// or srt:// URL, with --urlThe 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. source sends the stream as received. A channel with a ladder can also send one of its renditions, such as 720p, to a platform that limits bitrate. A destination fed by an input can only send source.

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|stop or hubfly stream control --destination-start;
  • the destination.start and destination.stop control ops;
  • a schedule, to go live on a platform at a set time.
bash
hubfly stream destinations start acme-tv sds_yt000001
hubfly stream destinations stop acme-tv sds_yt000001

Which destinations you started survives a restart or an upgrade of the media node. A disabled destination stays stopped.

StateDashboardMeaning
connectedSendingThe platform accepted the stream.
connectingConnectingOpening the connection.
retryingRetryingThe last attempt failed; the next one is scheduled.
stoppedStoppedNot started, or the source is not live.
errorFailedThe destination cannot send. last_error in the live status says why.
disabledDisabledConfigured 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) and hasSrtPassphrase, never the key.
  • To change a key, send a new streamKey on 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, rtmps and srt.
  • 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

To relay to a server you run, give it a public address and use the 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:

bash
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:

bash
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.

Something unclear or out of date? Emailsupport@hubfly.spaceBack to top