├── LICENSE ├── README.md ├── ezstream.xml ├── livewire-streamer.service └── stream.conf /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Neil Betham 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | livewire-streamer 2 | ================= 3 | This is a simple Ubuntu upstart script that runs some utilities to pipe audio from a Livewire network 4 | to an instance of Icecast. 5 | 6 | * Livewire is a protocol used in the broadcast industry to stream CD quality audio over a network. 7 | 8 | 9 | Setup 10 | ===== 11 | * Small Ubuntu VM on your Livewire network, I used 14.04, you can prolly get away with 1 core if you run server edition 12 | * `> apt-get install libav-tools ezstream dvbstream` 13 | * `libav-tools` for avconv utility, make sure it's installed with MP3 support 14 | * `ezstream` for streaming to icecast 15 | * `dvbstream` for the dumptrp utility 16 | 17 | 18 | 1. Use ftp://ftp.zephyr.com/pub/Axia/Tools/sdpgen.htm to get the multicast IP for your channel number 19 | * The line "c=IN IP4 239.192.0.203" has the ip you need 20 | 2. Edit stream.conf with your specific conversion/ip details 21 | 3. Edit ezstream.xml with your icecast details 22 | 4. If you are on Ubuntu 16.04, go to the directions below 23 | 5. Copy stream.conf to /etc/init/Unless you are running 16.04 in which case checkout the directions below 24 | 6. `> start stream` 25 | 7. ??? 26 | 8. Profit! 27 | 28 | ## Ubuntu 16.04 Systemd Configuration 29 | For Ubuntu 16.04 the init system was switch from Upstart to Systemd. As such you will need to use the example 30 | `livewire-streamer.service` Systemd unit file instead of the upstart conf file. 31 | 32 | 1. Copy the `livewire-stream.service` to `/etc/systemd/system/` 33 | 2. `> systemctl daemon-reload` 34 | 3. `> systemctl enable livewire-streamer.service` 35 | 4. `> systemctl start livewire-streamer.service` 36 | 5. ??? 37 | 6. Profit! 38 | 39 | Your streaming process should be up and running, this can be checked with `systemctl status livewire-streamer.service` 40 | 41 | 42 | Configuration 43 | ============= 44 | #### Output formatting 45 | * `avconv -f s24be -ar 48k -ac 2 -i - -f mp3 -b:a 320K -` This portion of the command transcodes the audio 46 | * `-f mp3` Change that to the format you want to stream / output, Check avconv -formats for output codecs 47 | * `-b:a 320K` Change 320K to the bit rate you want to stream 48 | 49 | Troubleshooting 50 | =============== 51 | * If the stream upstart job doesn't stay running check /var/log/upstart/stream for errors 52 | -------------------------------------------------------------------------------- /ezstream.xml: -------------------------------------------------------------------------------- 1 | 2 | http://ICECAST.ADDRESS.GOES.HERE:8000/stream 3 | 4 | hackme 5 | MP3 6 | stdin 7 | 1 8 | 9 | Awesome Stream Name 10 | http://awesomestream.org 11 | All 12 | This is my amazing web stream! 13 | 14 | 17 | 1 18 | 19 | -------------------------------------------------------------------------------- /livewire-streamer.service: -------------------------------------------------------------------------------- 1 | 2 | [Unit] 3 | Description=livewire-streamer 4 | After=network.target 5 | 6 | [Service] 7 | Slice=machine.slice 8 | ExecStart=/bin/bash -c 'dumprtp 239.192.0.202 5004 | avconv -f s24be -ar 48k -ac 2 -i - -f mp3 -b:a 320K - | ezstream -c /etc/ezstream.xml' 9 | KillMode=mixed 10 | Restart=always 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /stream.conf: -------------------------------------------------------------------------------- 1 | # Ubuntu upstart file at /etc/init/stream.conf 2 | respawn 3 | respawn limit 1 5 4 | post-stop exec sleep 5 5 | 6 | start on net-device-up IFACE=eth0 7 | stop on net-device-down IFACE=eth0 8 | 9 | script 10 | dumprtp 239.192.0.202 5004 | avconv -f s24be -ar 48k -ac 2 -i - -f mp3 -b:a 320K - | ezstream -c /etc/ezstream.xml 11 | end script 12 | --------------------------------------------------------------------------------