Standard streaming vs. SFU
In standard mode, Streampixel allocates one worker per user. Two users on the same project means two separate Unreal instances, two separate worlds, two separate save files. Useful for solo experiences (configurators, walkthroughs, tutorials). In SFU mode (Selective Forwarding Unit), Streampixel allocates one worker. The worker streams its video and audio to a media server, which fans the same stream out to every connected viewer. There is one Unreal instance, one world state, one set of game logic running.SFU is best when most viewers are passively watching what the host is doing. If every user needs independent control of their own avatar in a shared world, that is a true multiplayer game and belongs in a different architecture (dedicated UE server, players connect as Pixel Streaming clients with their own workers).
Roles
- Host — connects with
shared: { role: 'host' }. Their input drives the Unreal instance. Run one host page per room. - Viewer — connects with
shared: { role: 'viewer', hostStreamerId }. Receives video and audio. Viewers are watch-only.
appId (project ID). The room is the host’s stream.streamerId: the host page reads it and hands it to viewers, who pass it as hostStreamerId. The reference for all of this is Shared sessions.
Step 1 — Prerequisites
Step 2 — Host page
The host loads the project, opens the room and shows the link viewers need.Step 3 — Viewer page
Viewers connect withshared: { role: 'viewer', hostStreamerId }, where hostStreamerId is the host’s stream.streamerId. Here it arrives in the link the host page made.
Step 4 — Voice chat (optional)
Video and audio from the Unreal scene are already streamed. If you want viewers to talk to each other, addVoiceChat from @streampixel/web-sdk/voice, which is backed by LiveKit. Chat is in the npm package only (the script-tag build has none), and it must be switched on for the project in the dashboard. To add it, build the host and viewer pages with the npm package and your bundler instead of the script tag; the options are the same. Keep the stream in a variable:
userName. It is also their ID in the room, and a room holds each name once: when a second person joins with a name already in the room, the first is removed.
The room belongs to the project: without roomId, everyone on the project who joins is in one room. Give host and viewers of one session the same roomId to keep sessions apart. See Voice chat.
For UE-side voice (avatars speaking inside the game world), see Built-in voice and text chat.
UE-side considerations
The Unreal project does not magically become multiplayer-aware just because Streampixel is fanning out the stream. SFU streams whatever the one running UE instance renders. What this means in practice:- One PlayerController. The host’s input drives a single PlayerController. Viewers do not have their own pawns or cameras — they see exactly what the host’s camera is rendering.
- No replication needed. Because there is only one UE instance, you don’t need network replication, dedicated servers, or any of the multiplayer plumbing. It’s single-player UE that happens to have many spectators.
- Audio is mixed at the source. Anything played in the UE world is heard by all viewers. Spatial audio still works but the listener is the host’s audio listener, not each viewer’s.
- If you want viewer input — for example, voting, polls, drawing on the screen — carry it through your own backend to the host page, which sends it to Unreal as JSON with
stream.send(); handle it in Unreal Blueprint with a Pixel Streaming Input Component. Viewer pages are watch-only. The host remains in control of the camera and movement; viewers can only influence things you explicitly expose.
Limits
A single host can serve tens of viewers depending on bitrate, codec, and network conditions. Concrete planning numbers:
These are practical ceilings, not hard limits. For audiences in the hundreds, run multiple host sessions and load-balance.
Latency between the host and the furthest viewer is dominated by the SFU’s location and the viewer’s RTT. Pick a region close to the geographic center of your audience.
Gotchas
Viewer input is ignored
Viewer input is ignored
Mouse clicks, key presses, and gamepad input from viewer pages do not reach Unreal, and
stream.send() returns false on a viewer’s page. This is intentional — otherwise a hundred viewers could fight over the camera. If you need viewers to interact, route those interactions through your own application code (e.g., a “raise hand” button in your UI), not through raw input.No host migration: viewers wait for the host
No host migration: viewers wait for the host
There is no automatic host migration. When the host’s app restarts, or the connection closes for a reason that is not final, viewers wait for the host to come back: the state is
reconnecting with waitingForHost: true for a moment, then connecting until the stream returns. When no host comes back within about 3 minutes, the platform ends the viewer with code 4006; a viewer that cannot reach the platform at all keeps trying for up to 10 minutes. When the host’s video stops, viewers rejoin the room by themselves, up to three times (state recovering). A host that reloads its tab returns to the same room. Show “Waiting for the host” from that reconnecting state until the stream is back, and the ended event’s message when the wait is over.hostStreamerId is the join key
hostStreamerId is the join key
It must be exactly the host’s
stream.streamerId, which has the form <id>_<projectId>. A bare ID without the project part doesn’t reach the host. Read it on the host page and pass it to viewers unchanged.One host per room
One host per room
The host is the page that calls
create() with shared: { role: 'host' }. Run one host page per room: every other page joins as a viewer, with the room as hostStreamerId.Codec compatibility across viewers
Codec compatibility across viewers
SFU forwards the same encoded frames to every viewer. If the host encodes in AV1 (Chrome desktop only), viewers on Safari will not be able to decode. For broad audiences, lock the codec to H264. See Codec settings.
Next steps
Voice and text chat
UE-side voice and chat for in-game communication.
Meeting rooms
Pre-built room flows on top of LiveKit voice.
Performance tuning
Pick the right bitrate and codec for your viewer count.
Regions
Choose a region close to your audience.