
Automated Recording on the VPS
Configure OBS to record every stream simultaneously with the RTMP output. Or use ffmpeg to record the RTMP stream arriving at the relay:
# Record incoming stream while relaying it
ffmpeg -i rtmp://localhost/live/stream \
-c:v copy -c:a copy \
-f flv rtmp://live.twitch.tv/live/KEY \ # Forward to platform
/home/stream/recordings/$(date +%Y%m%d_%H%M%S).mp4 # Record locally
This records a lossless copy of your stream as it passes through the relay.
Automated Upload to YouTube
The YouTube Data API allows programmatic video upload. Use youtube-upload (Python CLI tool):
pip install youtube-upload
# Upload latest recording
youtube-upload \
--title "Stream VOD - $(date +%Y-%m-%d)" \
--description "Full stream recording from $(date)" \
--privacy-status "unlisted" \ # Or "public" if auto-titles are good
/home/stream/recordings/latest.mp4
Integrate with a cron job:
# Upload at 6 AM daily
0 6 * * * /home/stream/upload_vod.sh
Automated Clip Extraction with ffmpeg
For basic highlight extraction (top-performing timestamps from stream):
# Extract a specific time segment (e.g., known highlight at 2h15m)
ffmpeg -ss 02:15:00 -i stream_full.mp4 \
-t 00:10:00 \ # 10-minute clip
-c copy highlight_clip.mp4
With more sophisticated tools (Twitch clip data via API, chat activity heatmaps), you can extract clips at automatically-detected high-activity moments.
Storage Management
Full-quality VOD recordings are large (~15 GB for a 3-hour 1080p60 stream). Configure automatic cleanup:
# Delete recordings older than 30 days
find /home/stream/recordings/ -name "*.mp4" -mtime +30 -delete
Space-Node VPS plans include up to 100 GB NVMe storage, suitable for short-term VOD storage before upload and deletion.