YTPVSLS - VPS 24/7 YouTube Livestream System
Overview
A headless, production-ready system for running continuous 24/7 YouTube livestreams from a VPS using FFmpeg. Features a web-based multi-channel manager for controlling streams from any browser. No GUI, OBS, or browser required on the server side.
Repo: /mnt/c/Users/hanse/ytvpsls/
License: MIT
Core Features
Headless Operation — Runs entirely on a VPS via FFmpeg, no desktop environment needed
Web-Based Manager — Node.js control panel on port 3000 for managing channels, media, and streams
Multi-Channel Support — Run multiple simultaneous YouTube streams from one VPS
Hot-Swap Media — Switch images, videos, and audio on-the-fly without stopping streams
Auto-Restart — Streams recover automatically from disconnections via systemd
Low Resource Usage — ~5-15% CPU per stream (static images), ~15% for video loops
Architecture
System Layout (/opt/stream/)
/opt/stream/
├── manager/ # Web control panel (Node.js, port 3000)
├── scripts/ # install.sh, stream-runner.sh, health-check.sh
├── config/ # channels.json (channel configuration)
├── audio/ # MP3/WAV files organized by channel
├── images/ # JPG/PNG/WebP backgrounds
├── videos/ # MP4/MOV/MKV loops
└── logs/ # Stream logs
Tech Stack
Streaming Engine: FFmpeg (H.264 + AAC, RTMP to YouTube Live)
Web Manager: Node.js (Express-based API + frontend)
Process Management: systemd template units (yt-stream@channel-name)
Deployment: Ubuntu 22.04 VPS (Hetzner recommended)
API Endpoints
Endpoint Method Description /api/channelsGET List all channels /api/channelsPOST Create channel /api/channels/:idPUT Update channel /api/channels/:idDELETE Delete channel /api/channels/:id/startPOST Start stream /api/channels/:id/stopPOST Stop stream /api/channels/:id/swapPOST Swap media /api/media/:typeGET List media files /api/media/:type/uploadPOST Upload files /api/system/statsGET System statistics /api/healthGET Health check
Encoding Profiles
Profile CPU Usage Description Static Image + Audio 5-10% Lowest — wallpaper + looping audio Playlist Streaming 5-10% Concat playlist with static image Video Loop Higher Looping MP4 background + audio
Quality Reference
Resolution Video Bitrate Audio Total Bandwidth 720p 2500k 160k ~2.7 Mbps 1080p 4500k 192k ~4.7 Mbps
Visual Effects Available
Ken Burns — Slow zoom/pan on static images
Text Overlay — Channel name, labels
Clock Overlay — Live clock on stream
Color Adjustments — Night mode, warm/sunset filters
Audio Processing
Volume normalization (loudnorm)
Fade in/out
Bass boost
Dynamic compression
System Requirements
Streams vCPU RAM Upload 1 1 1 GB 5 Mbps 2-3 2 4 GB 10 Mbps
Recommended VPS: Hetzner CX21 (~$4.50/mo), DigitalOcean/Vultr/Linode (~$5-6/mo)
Deployment Workflow
Provision VPS — Ubuntu 22.04, configure firewall (UFW), install FFmpeg
Install System — Clone repo, run install.sh, run quick-setup.sh
Upload Content — SCP audio/images to /opt/stream/audio/ and /opt/stream/images/
Configure YouTube — Get stream key from YouTube Studio
Start Streaming — Via web UI at http://YOUR_IP:3000 or systemctl start yt-stream@channel-1
Production Setup — Enable auto-start, configure log rotation, add health-check cron (every 5 min)
{
"channels" : [{
"id" : "channel-1" ,
"name" : "Lofi Jazz Radio" ,
"enabled" : true ,
"streamKey" : "xxxx-xxxx-xxxx-xxxx" ,
"rtmpUrl" : "rtmp://a.rtmp.youtube.com/live2" ,
"audio" : { "type" : "playlist" , "source" : "/opt/stream/audio/jazz/playlist.txt" },
"video" : { "type" : "image" , "source" : "/opt/stream/images/cafe.jpg" , "resolution" : "1920x1080" , "fps" : 30 },
"encoding" : { "videoBitrate" : "2500k" , "audioBitrate" : "160k" , "preset" : "veryfast" , "tune" : "stillimage" }
}]
}
Common Operations
# Stream management
systemctl start | stop | restart yt-stream@channel-1
journalctl -u yt-stream@channel-1 -f
# Web manager
systemctl start | restart stream-manager
journalctl -u stream-manager -f
# Health check
/opt/stream/scripts/health-check.sh
Troubleshooting
Issue Solution Stream won’t start Verify stream key, check files exist, review logs with journalctl High CPU Use -preset ultrafast, static images instead of video, reduce to 720p Stream disconnects Check network, add reconnect flags, use backup RTMP server A/V desync Add -async 1 -vsync cfr -fflags +genpts Pixelated video Increase bitrate to 4500k, use -preset medium Web UI inaccessible Check firewall (port 3000), verify stream-manager service, check netstat
Documentation Files
README.md — Quick start, features overview, directory structure
docs.md — FFmpeg reference, encoding profiles, API endpoints, troubleshooting
setup.md — Complete VPS provisioning and deployment guide
Summary created: 2026-04-16