8. Stream to YouTube
8.1 Overview
The relay streams to YouTube using direct pass-through.
The YouTube relay uses a simple relay pattern - it forwards your stream directly to YouTube without any re-encoding or modification. This preserves your original stream quality for YouTube's reprocessing.
8.2 Enable YouTube
- In
env/relay.env, setYOUTUBE_KEYto the stream key provided by YouTube. -
Recreate the container so it reads the new values:
-
Confirm the service is enabled:
Expected output:
YouTube configuration complete, and service enabled.If you see
YOUTUBE_KEY is not set. Skipping YouTube configuration., check step 1. If you see anERROR:line, the container has stopped: correct the variable it names.
8.3 Settings
YOUTUBE_KEY is the only YouTube variable. For its valid values, see YouTube Variables.
8.4 A Note on YouTube's Re-encoding
YouTube reprocesses every video it receives, including live streams. This means YouTube applies its own encoding to your stream after receiving it.
Streams that appear acceptable at lower bitrates on platforms like Twitch will often appear distorted on YouTube after YouTube's re-encoding process. Ensure you send YouTube as high-quality/bitrate of a stream as possible to obtain the best results.
Refer to the Quality Optimization Guide and Bandwidth Requirements for:
- Bitrate recommendations
- Resolution and framerate considerations
- Bandwidth requirements
8.5 See Also
- Quality Optimization - Stream quality optimization
- Bandwidth Requirements - Network bandwidth guidance
- Architecture - Learn about relay patterns
- Quick Start - Initial setup instructions