Lightweight 24/7 Twitch and YouTube Music Radio using FFMPEG.
Install the following software on your machine: git, screen, alsa, mpg123 and ffmpeg
sudo apt install git screen alsa mpg123 ffmpeg
- Clone this repository
git clone https://github.com/NoniDOTio/LiveStreamRadio.git
- Add ALSA loopback (on some systems, you will have to re-run this command after every reboot)
sudo modprobe snd-aloop pcm_substreams=1
- Make loopback the default PCM device by adding it to
.asoundrc
echo 'pcm.!default { type plug slave.pcm "hw:Loopback,0,0" }' >> ~/.asoundrc
- Open
config.sh
in an editor and add your RTMP urls to PLATFORMS, remove any lines you don't need
PLATFORMS=(
"rtmp://a.rtmp.youtube.com/live2/1234-5678-90ab-cdef-ghij"
)
- Specify a file path for
MUSIC_DIR=
andBACKGROUND=
. Alternatively, you can move all your audio files to/media/music
. - Start streaming by launching the script
./lsr.sh --start
- Stop streaming by quitting the script
./lsr.sh --stop