A Streampixel session is a WebRTC peer connection between the user’s browser and a GPU worker. It carries an encoded video track, an optional audio track, and a bidirectional data channel for input and JSON messaging. Almost every knob you can tune — codec, resolution, bitrate, AFK behavior — maps to one of those three streams.Documentation Index
Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt
Use this file to discover all available pages before exploring further.
WebRTC in 60 seconds
WebRTC is the browser-native protocol for real-time audio, video, and data. Streampixel uses it because it’s already in every modern browser, has sub-100 ms end-to-end latency on a good network, and supports adaptive bitrate.| Concept | What it does |
|---|---|
| Peer connection | The end-to-end channel between browser and worker. Carries video, audio, and data. |
| ICE | The negotiation that picks the best path between peers (direct, NAT-pierced, or relayed). |
| STUN | Helps each peer learn its public IP so direct connections can be attempted. |
| TURN | Fallback relay used when firewalls or symmetric NATs block direct peer-to-peer. Streampixel runs TURN per region. |
| SDP | The offer/answer messages that describe what codecs and tracks each side supports. |
| Data channel | A bidirectional binary/text channel — Streampixel uses it for input, JSON messaging, and SDK metadata. |
STUN and TURN are handled automatically. You don’t configure ICE servers — the SDK pulls them at session start from signalling.
Codecs
The worker encodes Unreal’s framebuffer with one of four codecs. The browser advertises which codecs it supports during the SDP exchange and Streampixel falls back automatically when the requested codec isn’t available.| Codec | Browser support | Quality | CPU/GPU cost | Notes |
|---|---|---|---|---|
| H264 | Universal | Good | Low | Safe default. Hardware-accelerated almost everywhere. |
| VP8 | Universal | Good | Medium | Older, software-decoded in many browsers. |
| VP9 | Chrome, Firefox, Edge | Better than H264 at the same bitrate | Higher | Good for high-detail content over constrained links. |
| AV1 | Chrome desktop only | Best per-bit | Highest | Falls back automatically when unsupported. |
Resolution and bitrate
The encoder targets a resolution and a bitrate. Both can be fixed (locked to a value you pick) or adaptive (auto-tuned to the user’s network).- Adaptive (default)
- Fixed
The encoder shrinks resolution and drops bitrate when the network gets congested, then ramps back up when conditions improve. Best for the broadest audience and varied network quality.
| Setting | Common values | Effect |
|---|---|---|
| Resolution | 720p, 1080p, 1440p, 4K | Higher resolution = more pixels to encode and decode. Bandwidth grows roughly with pixel count. |
| Bitrate | 4 Mbps – 50 Mbps | Higher bitrate = better quality at a given resolution. Capped by the user’s downlink. |
| Frame rate | 30, 60, 90, 120 fps | Higher frame rate = smoother motion, more encoding work, more bandwidth. |
Latency
The “input lag” a user feels is the sum of several components. Cutting any one of them helps; cutting the worst offender helps most.| Component | Typical contribution | What controls it |
|---|---|---|
| Encode | 5–15 ms | Codec choice, GPU load, frame rate. |
| Network RTT | 20–150 ms | User-to-worker distance — pick the right region. |
| TURN relay (when used) | +10–30 ms | Network conditions; can’t be avoided behind restrictive firewalls. |
| Decode | 5–20 ms | Codec, browser, hardware acceleration availability. |
| Render frame | 8–16 ms (60 fps) | Browser compositor, monitor refresh. |
Input flow
Every input event the user generates is sent over the WebRTC data channel — not as separate HTTP calls. That keeps input latency on the same path as the video.Mouse
Position, buttons, wheel. Lock and confine modes for FPS-style controls. See mouse settings.
Keyboard
Key down, key up, character input. Browser shortcuts can be intercepted on demand.
Touch
Multi-touch points are forwarded to UE as touch events for mobile and tablet.
Gamepad
Standard Gamepad API devices map to UE input axes and buttons.
XR
WebXR sessions forward head and controller pose to UE for VR builds.
JSON messages
App-defined messages between page and UE — for menus, state sync, and custom UI.
Audio
Audio is bidirectional. Game audio flows out of UE to the browser; mic input flows from the browser to UE for voice-driven interactions.| Direction | Source | Codec |
|---|---|---|
| Worker → Browser | Unreal audio output | Opus (WebRTC default). Negotiated automatically. |
| Browser → Worker | User microphone | Opus. Requires microphone in the iframe allow attribute. |
Next steps
Codec settings
Pick the codec that fits your audience and content.
Resolution settings
Lock or adapt resolution and bitrate.
Session lifecycle
See how the peer connection opens, runs, and ends.
JSON message communication
The data channel carries more than input — it’s a full app-to-UE bus.