Studio and graphics
A mixer combines inputs, playlists and graphics into one program, like a vision mixer in a control room. You lay sources out in scenes, then switch scenes, move layers, change text and mix audio live, from the Dashboard studio, the CLI or the API. A channel plays the mixer's program like any other source.
Saving mixers and uploading graphics needs stream:admin. Live changes need stream:operate. Watching the studio needs stream:read.
Mixers
A server can have up to 5 mixers. Each has:
- a canvas: width and height from 160 × 90 to 3840 × 2160 in even numbers, 1–60 fps, and a background color;
- an output: the program's codec (
h264) and its video and audio bitrates; - sources, scenes, a default scene and a transition:
cut, orfadefor 0–5,000 ms.
Create one under Studio, or from a JSON spec with the CLI or POST …/stream/mixers/create:
{
"name": "Show",
"canvas": {"width": 1920, "height": 1080, "fps": 30, "background": "#000000"},
"output": {"codec": "h264", "videoBitrateKbps": 6000, "audioBitrateKbps": 160},
"sources": [
{"id": "cam", "type": "input", "ref": "sin_cam1abcd"},
{"id": "guest", "type": "input", "ref": "sin_guest001"},
{"id": "logo", "type": "image", "ref": "sgr_logo0001"},
{"id": "title", "type": "text", "text": "Live from Kigali",
"font": "Inter", "size": 48, "color": "#FFFFFF", "background": "#00000080"}
],
"scenes": [{
"id": "main", "name": "Main",
"layers": [
{"source": "cam", "x": 0, "y": 0, "w": 1920, "h": 1080,
"crop": {"l": 0, "t": 0, "r": 0, "b": 0}, "z": 0, "opacity": 1, "visible": true},
{"source": "guest", "x": 1380, "y": 60, "w": 480, "h": 270,
"crop": {"l": 0, "t": 0, "r": 0, "b": 0}, "z": 1, "opacity": 1, "visible": true},
{"source": "logo", "x": 40, "y": 40, "w": 160, "h": 160,
"crop": {"l": 0, "t": 0, "r": 0, "b": 0}, "z": 2, "opacity": 0.9, "visible": true}
],
"audio": [{"source": "cam", "gainDb": 0, "muted": false},
{"source": "guest", "gainDb": -3, "muted": false}]
}],
"defaultScene": "main",
"transition": {"type": "fade", "durationMs": 500}
}hubfly stream mixers create acme-tv --file show.json
hubfly stream channels update acme-tv Main --source mixer:smx_show0001A mixer cannot take its own output, even through another mixer, and channels never feed mixers.
Sources
Each source has an id you choose, such as cam, that scenes use to place it.
| Type | Fields | What it shows |
|---|---|---|
input | ref: an input (sin_…) | A live camera or encoder, with its audio |
playlist | ref: a playlist (spl_…) | Videos from Hubfly space Storage or https URLs. See playlists. |
image | ref: an image graphic | A PNG, JPEG or WebP, such as a logo |
svg | ref: an SVG graphic | Vector art, with live variables |
html | ref: an HTML bundle, width, height | Not available yet: renders transparent (see below) |
text | text, font, size, color, background | A line of text you can change live |
clock | format | The current time in the server's time zone. The format uses Go's reference layout; the default 15:04:05 shows hours, minutes and seconds. |
color | color | A solid color |
Colors are hex, with an optional alpha: #00000080 is half-transparent black.
Scenes, layers and audio
- Layers place a source on the canvas: position (
x,y, within twice the canvas size either way), size (w,h, above 0),cropin pixels from each edge, stacking orderz,opacityfrom 0 to 1, andvisible. A scene lists each source at most once. - Audio sets each source's gain from −60 to +12 dB and whether it is muted.
- The default scene plays when the mixer starts. Switching scenes uses the mixer's transition unless the switch names its own.
The studio in the Dashboard
The Studio section works like a control room. It needs a running server.
- Preview and Program monitors. Select a scene to preview it, then take it to program (Space or Enter).
- Sources and an Audio mixer with live level meters.
- A layer editor to place, crop and resize layers. On the scene that is on air, every change shows up live; Save to scene keeps it.
- Graphics: upload images, SVG and fonts, and send live variables.
- Go live from this browser: publish a camera or your screen, with a microphone, to an input that accepts WHIP.
The studio talks to the server over a WebSocket (wss://acme-tv.live.hubfly.app/v1/studio), signed in with a short-lived, single-use token the Dashboard issues. Up to 10 studio sessions can be open per server.
- Previews are free. Up to 4 at once per session, capped at 20 Mbps per server; beyond that the studio shows thumbnails.
- Meters report RMS and peak levels in dBFS, five times a second, for up to 16 watched sources. They are free.
The CLI follows the same socket. --meters prints audio levels:
hubfly stream tail acme-tv --meters --watch in:sin_cam1abcd,ch:sch_main0001Live control
Live changes are control ops. They apply at once, without saving the mixer, and survive a restart or an upgrade of the media node. A later configuration change keeps them unless it removes what they refer to.
| Op | Fields | Effect |
|---|---|---|
mixer.scene | mixer, scene, transition? | Switch the program scene |
mixer.layer | mixer, source, any of x y w h crop z opacity visible | Adjust a layer of the active scene |
mixer.audio | mixer, source, gainDb?, muted? | Change the audio mix |
mixer.text | mixer, source, text | Replace the text of a text source |
graphics.set | graphic, variables | Update a graphic's variables (below) |
hubfly stream scene switch acme-tv smx_show0001 main --fade 500ms
hubfly stream scene switch acme-tv smx_show0001 main --cut
hubfly stream control acme-tv --op '{"op":"mixer.text","mixer":"smx_show0001","source":"title","text":"Back in 5 minutes"}'With the API, send ops to POST …/stream/control. Ops run in order; a failing op does not undo the ones before it, and each has its own result:
curl -X POST "$STREAM/control" \
-H "Authorization: Bearer $HUBFLY_TOKEN" -H "Content-Type: application/json" \
-d '{"id": "ctl_scene00001", "ops": [
{"op": "mixer.scene", "mixer": "smx_show0001", "scene": "main",
"transition": {"type": "fade", "durationMs": 500}},
{"op": "mixer.audio", "mixer": "smx_show0001", "source": "guest", "muted": true}
]}'
# {"results": [{"ok": true}, {"ok": true}]}$STREAM is https://api.hubfly.space/api/v1/projects/$PROJECT_ID/managed/instances/$INSTANCE_ID/stream. See Live control and usage.
Graphics
Graphics are files you upload to the server for mixers and slates: a logo, a lower third, the card viewers see while a channel is offline.
| Kind | Files | Notes |
|---|---|---|
image | PNG, JPEG, WebP | PNG and JPEG must decode, up to 8192 × 8192 pixels |
svg | SVG | Supports live variables |
font | TTF, OTF | For text sources |
html | A ZIP with index.html at its root | Up to 20 MiB and 200 files uncompressed, no symlinks or paths outside the root. Not available yet. |
- Each file is at most 5 MiB. A server holds up to 200 graphics and 500 MiB in total.
- Upload under Studio → Graphics, or with
POST …/stream/graphics/uploadand{name, kind, contentType, dataBase64}.hubfly stream graphics list acme-tvlists them. - A graphic that scenes still use cannot be deleted. Remove it from those scenes first.
- Set the server's offline slate in its settings (
hubfly stream settings acme-tv --offline-slate <graphic>).
HTML graphics are not available yet
The media node does not have the HTML renderer at launch. You can upload HTML bundles and add them to scenes, but they render as transparent, and saving the mixer returns the warning graphics_html_unavailable. A visible HTML layer still counts 1.0 Mbps toward processing, so leave HTML layers out of your scenes for now.
Use image, SVG and text sources for logos, lower thirds and scoreboards. They work today.
Live variables
SVG graphics can have variables, such as a speaker's name or a score. Saved variables are the defaults (Studio → Graphics, or variables on PUT …/stream/graphics/:graphicId/update). graphics.set changes them live:
hubfly stream control acme-tv --op '{"op":"graphics.set","graphic":"sgr_score001","variables":{"home":"2","away":"1"}}'Variables are a map of strings: at most 64 keys, each value at most 1 KiB.
Text and fonts
Text and clock sources can use the built-in fonts Inter, Roboto, Noto Sans and JetBrains Mono. For any other font, upload a TTF or OTF as a font graphic and set the source's font to its id. mixer.text replaces a text source's text live.
Processing
A mixer program bills 1.5 × its billed video Mbps while it runs: its video bitrate or the floor for the canvas height and frame rate, whichever is higher. A 1080p30 program at 6,000 kbps bills 1.5 × 6.0 = 9.0 Mbps, about $0.036 per hour.
Raise the processing cap for a 1080p mixer
hubfly stream speed acme-tv 100 --processing 16), or the mixer stays rejected. Mixers start before channel ladders. See the processing cap.Studio previews, thumbnails and meters are free. See pricing and limits.