Skip to main content

Overview

Hyperscape streams gameplay to multiple RTMP destinations simultaneously using FFmpeg’s tee muxer for efficient single-encode multi-output.

Supported Platforms

Active Platforms

  • Twitch - rtmp://live.twitch.tv/app
  • Kick - rtmps://fa723fc1b171.global-contribute.live-video.net/app (RTMPS)
  • X/Twitter - rtmp://sg.pscp.tv:80/x

Removed Platforms

  • YouTube - Explicitly disabled (set YOUTUBE_STREAM_KEY="" to prevent stale keys)
YouTube was removed from default streaming destinations in February 2026. To re-enable, set YOUTUBE_STREAM_KEY and YOUTUBE_RTMP_URL.

Configuration

Environment Variables

Get Stream Keys

Twitch:
  1. Go to Twitch Dashboard
  2. Copy Primary Stream Key
  3. Set as TWITCH_STREAM_KEY
Kick:
  1. Go to Kick Creator Dashboard
  2. Navigate to Stream Settings
  3. Copy Stream Key
  4. Set as KICK_STREAM_KEY
X/Twitter:
  1. Go to Media Studio
  2. Click ProducerCreate BroadcastCreate Source
  3. Copy RTMP URL and Stream Key
  4. Set as X_RTMP_URL and X_STREAM_KEY
X/Twitter streaming requires X Premium subscription for desktop streaming.

Streaming Quality

Balanced Mode (Default)

Optimized for smooth playback and viewer experience:
Settings:
  • Tune: film (allows B-frames for better compression)
  • Buffer: 4x bitrate (18000k for 4500k bitrate)
  • Lookahead: Better bitrate smoothing
  • Use Case: Passive viewing, longer streams, unstable connections
FFmpeg Args:

Low Latency Mode

Optimized for minimal delay:
Settings:
  • Tune: zerolatency (no B-frames)
  • Buffer: 2x bitrate (9000k for 4500k bitrate)
  • No lookahead: Immediate encoding
  • Use Case: Interactive streams, live betting, viewer interaction
FFmpeg Args:

Quality Settings

Canonical Platform

The canonical platform determines default public delay for anti-cheat timing:
Platform Defaults:
  • youtube → 15000ms delay
  • twitch → 12000ms delay
  • hls → 4000ms delay
Set STREAMING_PUBLIC_DELAY_MS=0 for live betting with no delay. This disables anti-cheat timing protection.

Audio Configuration

Enable Audio Capture

See Audio Streaming for complete PulseAudio setup.

Disable Audio

FFmpeg will use silent audio (anullsrc).

FFmpeg Configuration

Complete Command

Input Buffering

Audio Buffering:
Video Buffering:

Output Buffering

Kick RTMP URL Fix

Problem

Kick streaming used incorrect URL:

Solution

Use proper IVS endpoint with RTMPS:
Why:
  • Kick uses AWS IVS (Interactive Video Service)
  • Regional ingest endpoints (not generic domain)
  • RTMPS (RTMP over TLS) for secure streaming
  • /app path required

Stream Key Security

Masked Logging

Stream keys are masked in logs:
Output:

Explicit Unset

Prevent stale stream keys from being used:

Streaming Diagnostics

RTMP Status File

Example Output:

Check FFmpeg Processes

Check PM2 Logs

Troubleshooting

Stream Not Appearing

1. Check stream keys are set:
2. Check FFmpeg is running:
3. Check RTMP status:
4. Check platform dashboards:

Audio Not in Stream

See Audio Streaming Troubleshooting.

Buffering Issues

Increase buffer size:
Use balanced mode:

Connection Drops

Check network stability:
Increase reconnect attempts:

High CPU Usage

Reduce encoding preset:
Reduce resolution:
Reduce framerate:

Advanced Configuration

Custom RTMP Destination

JSON Fanout Config

For additional destinations:

RTMP Multiplexer

Use a multiplexer service (Restream, Livepeer) for fanout:
Benefits:
  • Single stream to multiplexer
  • Multiplexer fans out to all platforms
  • Reduces server bandwidth and CPU usage

Local Testing

nginx-rtmp Server

Test RTMP streaming locally:

Test Command

This starts streaming to local nginx-rtmp server for testing.

Production Deployment

PM2 Configuration

GitHub Secrets

Configure in Settings → Secrets → Actions:

Deployment Script

The scripts/deploy-vast.sh explicitly manages stream keys:

Monitoring

Stream Health

FFmpeg Stats

Platform Dashboards

Twitch: Kick:
  • Creator Dashboard
  • Shows stream status and viewers
X:

Audio Streaming

PulseAudio audio capture setup

Vast.ai Deployment

Complete Vast.ai deployment guide

Configuration

Environment variables and settings

Troubleshooting

Common issues and solutions