The lo-fi hip hop radio format has proven remarkably durable: relaxed music combined with an animated loop visual generates passive viewership that accumulates to significant channel growth over months. The catch: manual 24/7 Twitch or YouTube streaming is impractical. This entire setup runs unattended on a VPS.
What You Need
- A VPS (2 vCores, 2 GB RAM minimum for streaming)
- DMCA-safe music library (see below)
- A looping visual (animated .mp4 or generated frames)
- ffmpeg (software encoding)
ffmpeg-Based Stream Loop
The simplest possible approach, with no OBS required:
#!/bin/bash
# stream_loop.sh
#
# Input 0: your animated visual, looped forever
# Input 1: your concatenated music file, also looped
# -map keeps the video from input 0 and the audio from input 1,
# so a sound track inside the visual file is ignored
# -force_key_frames sets a keyframe every 2 seconds, which YouTube and Twitch expect
#
# Keep comments above the command: a comment after a trailing
# backslash breaks the line continuation.
RTMP_KEY="your_twitch_or_youtube_stream_key"
RTMP_URL="rtmp://live.twitch.tv/live"
ffmpeg -re \
-stream_loop -1 -i /home/stream/lofi_visual.mp4 \
-stream_loop -1 -i /home/stream/music_concat.mp3 \
-map 0:v:0 -map 1:a:0 \
-c:v libx264 -preset veryfast -b:v 6000k \
-force_key_frames "expr:gte(t,n_forced*2)" \
-c:a aac -b:a 160k \
-f flv "$RTMP_URL/$RTMP_KEY"
Run with PM2:
pm2 start stream_loop.sh --name lofi-stream
pm2 save
Building Your Music Library
DMCA-safe music options:
- Chillhop Music: Explicit permission for streams under their specific terms
- StreamBeats (Harris Heller): Royalty-free, created specifically for streams
- Monstercat Gold: Licence covers streaming with monthly subscription
- Artlist.io: Annual licence covering streaming rights
- Your own music: Commission tracks from royalty-free composers
Avoid: any playlist or library that doesn't explicitly state streaming rights. YouTube's Content ID and Twitch's automated DMCA detection will mute VoDs.
Concatenating Your Music Library
# Create a file list for ffmpeg:
ls /home/stream/music/*.mp3 > /tmp/music_list.txt
# Prepend 'file' to each line:
sed -i "s/^/file '/" /tmp/music_list.txt
sed -i "s/$/'/" /tmp/music_list.txt
# Concatenate all files into one:
ffmpeg -f concat -safe 0 -i /tmp/music_list.txt \
-c copy /home/stream/music_concat.mp3
Playlist Randomiser
For variety, shuffle the track order each stream cycle:
# Random shuffle with shuf:
ls /home/stream/music/*.mp3 | shuf | \
sed "s/^/file '/" | sed "s/$/'/" > /tmp/music_list.txt
Sizing the VPS
The smallest Standard VPS at Space-Node, VPS-S, has 3 vCores and 4GB RAM. x264 encoding at the veryfast preset is the heaviest part of this setup, so watch CPU use with htop during the first hour. If it stays high, lower the output resolution or move to a plan with more vCores.
Start your 24/7 lo-fi stream on Space-Node VPS
Prefer OBS Over a Script?
This ffmpeg loop has no chat box, no now-playing widget and no visualizer that reacts to the music. If you want those, a Windows streaming server with OBS pre-installed is the easier route. Our 24/7 lofi stream guide covers that setup, from the looping visual to the chat overlay.