High-performance real-time video streaming for Godot — encode game frames and stream them to browsers via WebRTC with hardware-accelerated encoding.
- 🎮 Godot Native — GDExtension plugin with zero-GC viewport capture and C# fallback
- 📺 WebRTC Streaming — Millisecond latency with keyboard/mouse/gamepad input relay
- 🚀 Multi-Codec — H264 / H265 / AV1 / VP9 with auto GPU encoder selection (NVENC / QSV / AMF / VAAPI)
- 📦 Native AOT — Core library compiles to native DLL/SO, callable from C++ engines (UE5, etc.) via C API
- 📱 Cross-Platform — Windows / Linux / macOS
Download the latest gstream-v*-gde-win-x64.zip from Releases, extract into your Godot project, and enable the plugin.
- Copy
demo/gstream-godot/addons/gstream/into your Godot project'saddons/gstream/ - Enable the plugin in Project → Project Settings → Plugins
- Add a
StreamServernode to your scene
cd src/gstream-webapp
npm install && npm run build
npm start # Listens on port 80, use --port to change| Component | Version |
|---|---|
| Godot | 4.6+ (standard for GDE, .NET for C# plugin) |
| .NET SDK | 10.0 |
| Node.js | 18+ (signaling server) |
| OS | Windows 10+ / Linux x64 / macOS |
| GPU | H264 | H265 | AV1 |
|---|---|---|---|
| NVIDIA NVENC (GTX 9xx+) | ✅ | — | |
| NVIDIA NVENC (RTX 40+) | ✅ | ✅ | ✅ |
| Intel QSV (Arc / 11th Gen+) | ✅ | ✅ | ✅ |
| AMD AMF (RX 5000+) | ✅ | ✅ | |
| Apple VideoToolbox | ✅ | ✅ | — |
| Software (libx264/libvpx) | ✅ | — | ✅ |
streamServer.Codec = VideoCodec.Auto; // Auto-negotiate (recommended)
streamServer.Codec = VideoCodec.H264_High_L31; // Best compatibility
streamServer.Codec = VideoCodec.AV1_Main_L5; // Best quality (RTX 40+)
streamServer.Codec = VideoCodec.VP9_Profile0; // Royalty-free (CPU)Full codec table and SDP details → README_CN.md § 编解码器支持
Godot Engine
├── StreamServer (Node)
│ ├── ViewportCapture → FFmpeg Encoder
│ └── WebRTC Streamer → Signaling Server → Browser
└── gstream_native (C++ GDExtension, optional)
Detailed architecture diagrams → README_CN.md § 架构
src/
├── gStream.Core/ # Core library (encoding / WebRTC / signaling)
├── gStream.GDExtension/ # Native AOT GDExtension
├── gstream-webapp/ # Signaling server + web client (TypeScript / Express)
demo/
├── gstreamGodot/ # Godot .NET demo
└── gstreamGdedemo/ # GDExtension demo (no .NET SDK required)
cd demo/gstreamGodot
dotnet build# Windows x64
dotnet publish src/gStream.Core/gStream.Core.csproj -r win-x64 -c Release -p:PublishAot=true
# Linux x64
dotnet publish src/gStream.Core/gStream.Core.csproj -r linux-x64 -c Release -p:PublishAot=truecd src/gstream-webapp
npm install && npm run build
npm startFull build guide → README_CN.md § 从源码构建
| Function | Description |
|---|---|
gstream_session_create(w, h, fps, bitrate, codec, preset, url, addr, recv) |
Create streaming session |
gstream_push_frame(session, w, h, stride, data) |
Push BGRA32 frame |
gstream_push_frame_direct(session, w, h, stride, data) |
Push frame (zero-copy) |
gstream_push_audio(session, samples, count) |
Push float32 PCM samples |
gstream_force_keyframe(session) |
Force next frame as keyframe |
gstream_is_connected(session) |
Check WebRTC connection status |
gstream_session_destroy(session) |
Destroy session |
Complete API reference → README_CN.md § 导出的 C API
- H265 WebRTC — Chrome requires experimental flag, Firefox not supported. Use AV1 or H264 instead.
MIT
