Hubfly spaceDocs
Console

Create a stream server

Creating a stream server needs the stream:admin permission. You see the speed price before you confirm. Speed is billed for each hour the server runs; bandwidth and encoding are billed as you use them. A stopped server costs nothing.

Where Managed Streams is not offered yet, creating a server is refused with MANAGED_SERVICES_UNAVAILABLE, and when the media node is full with STREAM_CAPACITY_FULL. Nothing is created or billed in either case.

Create a server in the Dashboard

  1. Open a Managed service project, or create one, and choose Streams.
  2. Enter a name. It becomes part of the hostname, for example acme-tv.live.hubfly.app.
  3. Pick a speed: the most your server may send at once, to viewers and destinations together. 25 Mbps covers a 6 Mbps stream pushed to three platforms; 100 viewers of a 4 Mbps stream need about 400 Mbps. You can change it at any time without interrupting anything.
  4. Choose the server's time zone. Schedules run in it.
  5. Keep the first input to get a push input and its stream key right away.
  6. Review the price and choose Create. The stream key is shown once, with the settings for OBS. Copy it into your encoder now; you can reveal it again later from Inputs.

Speed above 250 Mbps

Until your account has made a real deposit (promotional balance does not count), a server's speed is limited to 250 Mbps and creating more is refused with STREAM_SPEED_LIMIT. Each account can have up to 5 stream servers; support can raise both limits.

Create a server with the CLI

hubfly stream create shows the speed price, asks you to confirm, waits until the server is ready and prints the first input's stream key once, with OBS settings:

bash
hubfly stream create acme-tv --speed 100 --timezone Africa/Kigali --project new
# In an existing managed project, from a script:
hubfly stream create acme-tv --speed 25 --project media --yes --json
hubfly stream info acme-tv

Connect an encoder

An input's page shows its URL for every protocol it accepts. In OBS:

  1. Open Settings → Stream and set Service to Custom….
  2. Server: rtmps://acme-tv.live.hubfly.app:443/live
  3. Stream Key: the key that starts with hfls_.
  4. In Output, use H.264 with a keyframe interval of 2 seconds. For sub-second WebRTC playback, also turn B-frames off (see OBS and encoders).
  5. Choose Start Streaming. The input turns Live in the Dashboard, with its bitrate, frame rate and keyframe interval.

To test without OBS, push a file with ffmpeg or with the CLI, which keeps the key out of ffmpeg's command line:

bash
hubfly stream push acme-tv show.mp4 --loop

ffmpeg -re -i show.mp4 -c:v libx264 -preset veryfast -b:v 4500k -g 60 -bf 0 \
  -c:a aac -b:a 160k -f flv "rtmps://acme-tv.live.hubfly.app:443/live/$STREAM_KEY"

Keep stream keys secret

Anyone with a stream key can publish to your input. Keep it in your encoder only: never in client code, a repository or a log. If it leaks, rotate it under Inputs → Keys or with hubfly stream inputs keys rotate; the encoder using the old key is disconnected.

Add a channel

A channel is what viewers watch. Under Channels, choose New channel:

  • Source: your input (later a mixer or a playlist).
  • Encoding: Passthrough sends the stream as it arrives and costs no processing. Add a ladder of lower renditions for viewers on slow connections; see transcoding.
  • Latency: Ultra prefers WebRTC (under a second), Low uses LL-HLS (3–5 seconds), Standard uses HLS (15–25 seconds).
  • Access: Public, or Token to require a signed playback token (see playback security).
bash
hubfly stream channels create acme-tv Main --source input:sin_cam1abcd --latency ultra --dvr 60
hubfly stream channels playback acme-tv Main   # URLs and embed code

Watch it on your site

The quickest way is the embed page, which picks WebRTC, LL-HLS or HLS on its own:

html
<iframe src="https://acme-tv.live.hubfly.app/embed/sch_main0001?autoplay=1&muted=1"
  style="width:100%;aspect-ratio:16/9;border:0"
  allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>

Or use the player element from @hubfly/streams to style it and follow its state:

html
<script type="module">
  import "@hubfly/streams/player";
</script>

<hubfly-player host="acme-tv.live.hubfly.app" channel="sch_main0001" autoplay muted></hubfly-player>

Browsers allow autoplay only when muted; without autoplay the player shows a Play button. https://acme-tv.live.hubfly.app/status/sch_main0001.json tells your page whether the channel is live and how many people watch.

Restream it

Under Destinations, add YouTube, Twitch, Facebook, Kick, X, LinkedIn or a custom RTMP(S) or SRT target, paste the platform's stream key, and turn on Auto-start to go live there whenever the channel does. From the CLI, the key is read from standard input so it never lands in your shell history:

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

Restream copies cost no processing; the bytes pushed count as bandwidth. See restreaming.

Connect a Cell project

A binding writes the server's details into a Cell project, so your app can build player URLs and sign playback tokens:

VariableValue
HUBFLY_STREAM_URLhttps://acme-tv.live.hubfly.app
HUBFLY_STREAM_PLAYBACK_KEY_IDWith a playback key: its id, such as spk_key00001
HUBFLY_STREAM_PLAYBACK_KEY_SECRETWith a playback key: its secret. Server code only.
bash
hubfly stream bindings create acme-tv --to web --playback-key spk_key00001 --channel sch_main0001

When you rotate the playback key, the binding is updated with the new one.

Next steps

  • Build scenes with several cameras, a logo and lower thirds.
  • Schedule shows or run a 24/7 channel from Hubfly space Storage.
  • Record every show to Hubfly space Storage.
  • Watch usage under Usage & speed or with hubfly stream usage acme-tv.
Something unclear or out of date? Emailsupport@hubfly.spaceBack to top