This is a simple set of Ubuntu scripts that runs some utilities to pipe audio from a Livewire network to an instance of Icecast.
- Livewire is a proprietary branch of AES69 protocol used in the broadcast industry to stream CD quality audio over a network.
You need a small Ubuntu VM on your Livewire network, I used 16.04, you can probably get away with 1 core if you run server edition. Suppose your current user is axia.
-
Configure multicast on your Livewire network interface. Suppose it's
ens33:sudo ifconfig ens33 multicast -
Don't forget to add route of multicast traffic to your Livewire interface if you have more than one network interface:
sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev ens33or add route to/etc/network/interfaces:
auto ens33
iface ens33 inet static
address 172.22.0.100
netmask 255.255.0.0
network 172.22.0.0
broadcast 172.22.255.255
up route add -net 224.0.0.0 netmask 240.0.0.0 dev ens33
and restart interface: sudo ifdown ens33 && ifup ens33
-
Do Linux Update:
sudo apt update && sudo apt upgrade -y -
Install AVconv, dumpRTP and ezStream:
sudo apt install -y libav-tools ezstream dvbstream
libav-toolsfor avconv utility, make sure it's installed with MP3 supportezstreamfor streaming to icecastdvbstreamfor the dumptrp utility
- Copy
stream.shandstream-restart.shto user's home folder:/home/axia/
- Set permissions for www-data:
sudo chown www-data:www-data /home/axia/stream*.sh && sudo chmod +x /home/axia/stream*.sh
- Edit
ezstream.xmlfor your Icecast connecting.
- Copy
ezstream.xmlto/home/axia/ - Permissions for
ezstream.xmlare axia:axia and 644.
- Create
streamservice for systemd:
- put
stream.serviceto/etc/systemd/system/ sudo chmod 644 /etc/systemd/system/stream.servicesudo chown root:root /etc/systemd/system/stream.service
- Reload systemd:
sudo systemctl daemon-reload - Enable and start service:
sudo systemctl enable stream && sudo systemctl start stream - Check service status:
sudo systemctl status streamorsudo journalctl -u stream - Edit service configuration:
sudo systemctl edit --full streamNotice that service is running fromwww-datauser (User=www-data).
-
Install Apache2 and PHP:
sudo apt install -y apache2 php -
Edit
index.php:
- find strings
http://YOUR-ICECAST-SERVER:8000/axiaand replace this address of stream accordinglyezstream.xmlsettings
-
Copy
index.phpto /var/www/html -
Open http://your-ubuntu-host/index.php in browser, input Livewire channel, click "Write config to File" and click PLAY link.
avconv -f s24be -ar 48k -ac 2 -i - -f mp3 -b:a 320K -This portion of the command transcodes the audio-f mp3Change that to the format you want to stream / output, Check avconv -formats for output codecs-b:a 320KChange 320K to the bit rate you want to stream
- Check service status:
sudo systemctl status streamorsudo journalctl -u stream
