Icecast является серверной программой, которая может осуществлять раздачу цифровых потоков различных форматов, таких как Ogg Vorbis, Opus, MP3, Theora, AAC, AAC Plus и NSV. Собственно, передача данных осуществляется по стандартному протоколу HTTP, либо по протоколу SHOUTcast.
Icecast является аналогом программы SHOUTcast компании Nullsoft, однако имеет более развитую функциональность и поддерживает большее количество форматов потоков. При передаче данных Icecast поддерживает теги в UTF-8, что позволяет организовывать трансляцию с русской аннотацией.
Для начала установим Icecast2:
Код
$ sudo apt-get install icecast2
Настраиваем пароли:
Имя узла Icecast2 оставляем localhost:
Прописываем пароль к источникам Icecast:
Пароль к релею:
Пароль в веб интерфейс:
Проверяем разрешение на запуск Icecast2:
Код
$ sudo nano /etc/default/icecast2
Переменная ENABLE должна быть в true:
Код
ENABLE=true
Файл настроек в Ubuntu находится по пути /etc/icecast2/icecast.xml:
Код
$ sudo nano /etc/icecast2/icecast.xml
Пароли находятся в части authentication:
Код
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>pass1</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>pass2</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>SpyCs</admin-user>
<admin-password>pass3</admin-password>
</authentication>
<!-- Sources log in with username 'source' -->
<source-password>pass1</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>pass2</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>SpyCs</admin-user>
<admin-password>pass3</admin-password>
</authentication>
Выбираем порт:
Код
<listen-socket>
<port>8081</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
<!-- <shoutcast-mount>/stream</shoutcast-mount> -->
</listen-socket>
<port>8081</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
<!-- <shoutcast-mount>/stream</shoutcast-mount> -->
</listen-socket>
Пример настройки релея для ретрансляции с внешних радиопотоков:
Код
<relay>
<server>cast.radiogroup.com.ua</server>
<port>8000</port>
<mount>/retro</mount>
<local-mount>/Retro-128</local-mount>
<on-demand>1</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
<relay>
<server>radio.north.kz</server>
<port>8000</port>
<mount>/vestifm</mount>
<local-mount>/vestifm-192</local-mount>
<on-demand>1</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
<server>cast.radiogroup.com.ua</server>
<port>8000</port>
<mount>/retro</mount>
<local-mount>/Retro-128</local-mount>
<on-demand>1</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
<relay>
<server>radio.north.kz</server>
<port>8000</port>
<mount>/vestifm</mount>
<local-mount>/vestifm-192</local-mount>
<on-demand>1</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
Перезапускам Icecast2:
Код
$ sudo service icecast2 restart
или
Код
$ sudo /etc/init.d/icecast2 restart
Код
root@server6531:~# service icecast2 restart
Restarting icecast2: Starting icecast2
Detaching from the console
icecast2.
root@server6531:~#
Restarting icecast2: Starting icecast2
Detaching from the console
icecast2.
root@server6531:~#
Вход на веб интерфейс в моем случае: http://имя_сервера:8081/