ОсновноеRadiotalkПользовательское
Технологии вещания, софт, скрипты
6   •   Посмотреть все темы

liquidsoap

 

419
gyurgin_ @gyurgin_
Вот оно что, ну liquisoap, скрипт на php и ничего сложного.

23
sergey_iron @sergey_iron
gyurgin_ пишет:

Вот оно что, ну liquisoap, скрипт на php и ничего сложного.


так с чего начать?
можно по пунктам? и подробнее?

419
gyurgin_ @gyurgin_
И на кой черт Вам всем здался debian чистый. Я пользую его для совсем слабых устройств, так тоже там все с умом и знаючи...
Берите ubuntu - не прогадаете.

23
sergey_iron @sergey_iron
gyurgin_ пишет:

И на кой черт Вам всем здался debian чистый. Я пользую его для совсем слабых устройств, так тоже там все с умом и знаючи...
Берите ubuntu - не прогадаете.


А какой именно?

419
gyurgin_ @gyurgin_
16 канеш

23
sergey_iron @sergey_iron
gyurgin_ пишет:

16 канеш


ок, поставил убу 16, зашел под рутом, а что дальше?

419
gyurgin_ @gyurgin_
Офигеть, Вам что от и до?

23
sergey_iron @sergey_iron
gyurgin_ пишет:

Офигеть, Вам что от и до?


Я все делал по инструкции, не получилось
Поэтому прошу вашей помощи

419
gyurgin_ @gyurgin_
Я не мастер писать мануалы. Все в код sudo apt-get install mc ladspa-sdk libtool autoconf libexpat1-dev libfftw3-dev software-properties-common python-software-properties libvorbis-dev automake git python-dev curl libcurl4-openssl-dev g++ libxml-dom-perl liblo-dev libasound2-dev libflac++-dev libflac++6v5 libflac8 libexpat1-dev libfftw3-dev libglib2.0-dev libfluidsynth-dev lv2core libglade2-dev gtk2-engines-pixbuf libcairo2-dev libxml2-dev libfdk-aac-dev lame libmp3lame-dev libfaad-dev libvo-aacenc-dev libncurses5-dev libao-dev libfaad-dev libmad0-dev libavutil-dev libogg-dev libopus-dev libsamplerate0-dev libsoundtouch-dev libtag1-dev libvo-aacenc-dev libmad0-dev libxslt1-dev libtool-bin

под рутом
Icecast KH

wget **********
tar xvf icecast-2.3.3-kh11.tar.gz
cd icecast-kh-icecast-2.3.3-kh11
./configure --prefix=/usr --with-curl --with-openssl
make
sudo make install
/usr/bin/icecast -v
рекомендованный сервер
можно и новый, но сука там проблемы.
теперь под пользователем
sudo apt-get install ocaml opam
opam init
спрашивает - пишем y
eval `opam config env`
opam install cmdliner depext base-bytes
opam install base-bytes
opam depext aacplus.0.2.2
opam install pcre taglib soundtouch samplerate camomile ao mad opus xmlplaylist soundtouch aacplus faad voaacenc ladspa cry lame fdkaac liquidsoap vorbis
eval `opam config env`
opam install cmdliner depext base-bytes
opam install base-bytes
opam depext aacplus.0.2.2
opam install pcre taglib soundtouch samplerate camomile ao mad opus xmlplaylist soundtouch aacplus faad voaacenc ladspa cry lame fdkaac liquidsoap vorbis
каждая строка - команда

419
gyurgin_ @gyurgin_
Для ubuntu 16 онлу!!!

23
sergey_iron @sergey_iron
gyurgin_ пишет:

Я не мастер писать мануалы. Все в код sudo apt-get install mc ladspa-sdk libtool autoconf libexpat1-dev libfftw3-dev software-properties-common python-software-properties libvorbis-dev automake git python-dev curl libcurl4-openssl-dev g++ libxml-dom-perl liblo-dev libasound2-dev libflac++-dev libflac++6v5 libflac8 libexpat1-dev libfftw3-dev libglib2.0-dev libfluidsynth-dev lv2core libglade2-dev gtk2-engines-pixbuf libcairo2-dev libxml2-dev libfdk-aac-dev lame libmp3lame-dev libfaad-dev libvo-aacenc-dev libncurses5-dev libao-dev libfaad-dev libmad0-dev libavutil-dev libogg-dev libopus-dev libsamplerate0-dev libsoundtouch-dev libtag1-dev libvo-aacenc-dev libmad0-dev libxslt1-dev libtool-bin

под рутом
Icecast KH

wget **********
tar xvf icecast-2.3.3-kh11.tar.gz
cd icecast-kh-icecast-2.3.3-kh11
./configure --prefix=/usr --with-curl --with-openssl
make
sudo make install
/usr/bin/icecast -v
рекомендованный сервер
можно и новый, но сука там проблемы.
теперь под пользователем
sudo apt-get install ocaml opam
opam init
спрашивает - пишем y
eval `opam config env`
opam install cmdliner depext base-bytes
opam install base-bytes
opam depext aacplus.0.2.2
opam install pcre taglib soundtouch samplerate camomile ao mad opus xmlplaylist soundtouch aacplus faad voaacenc ladspa cry lame fdkaac liquidsoap vorbis
eval `opam config env`
opam install cmdliner depext base-bytes
opam install base-bytes
opam depext aacplus.0.2.2
opam install pcre taglib soundtouch samplerate camomile ao mad opus xmlplaylist soundtouch aacplus faad voaacenc ladspa cry lame fdkaac liquidsoap vorbis
каждая строка - команда


До момента: теперь под пользователем все сделал.
Дальше вопрос: необходимо создать этого пользователя, или прямо так дальше и писать: sudo apt-get install ocaml opam ???

23
sergey_iron @sergey_iron
выполняю:
opam init

выдает:
fatal error
opam: 'mkdir' failed on /home/radio: Permission denied

Что не так?

23
sergey_iron @sergey_iron
gyurgin_ пишет:

Для ubuntu 16 онлу!!!


все делал под вашим руководством.... что то не получается ((

23
sergey_iron @sergey_iron
Может кто нибудь мне тут помочь?

419
gyurgin_ @gyurgin_
useradd radio
passwd radio
addgroup radio sudo
mkdir /home/radio
chown radio:radio /home/radio
su radio

И потом уже
opam init и так далее.

23
sergey_iron @sergey_iron
проблема следующая:
icecast2 запускается, а liquidsoap - не понятно. то ли запустился, то ли нет.
в icecast не появляется значок плейлиста.

вот файлы настроек:

/home/radio/start_liquidsoap.liq


#My Inet Radio config
#Log dir and parametrs

set("log.file.path","/var/log/liquidsoap/myinetradio.log")
set("log.file.path","/home/radio/myinetradio.log")

set("log.stdout", true)

#Set tag encoding
set("tag.encodings",["UTF-8"])

# Use the telnet server for requests
set("server.telnet", true)

# Live Settings
set("harbor.bind_addr","0.0.0.0")



#Rewrite tags

def live_tag(j)
rewrite_metadata([("title","Прямой эфир")], update=false, strip=true, j)
end

def live_rep_tag(j)
rewrite_metadata([("title","Повтор прямого эфира")], update=false, strip=true, j)
end

def my_rec_tag(j)
rewrite_metadata([("title","Моя передача")], update=false, strip=true, j)
end

def den_tag(j)
rewrite_metadata([("title","Дневная музыка")], update=false, strip=true, j)
end

def jin_tag(j)
rewrite_metadata([("title","Мое интернет-радио")], update=false, strip=true, j)
end

#Live input
live = audio_to_stereo(live_tag(input.harbor(id="LIVE", port=8010, password="mystationpassword", "live")))
liveover = audio_to_stereo(input.harbor(port=8010, password="mystationpassword2", "liveover"))

#Records play
live_rep = audio_to_stereo(live_rep_tag(request.queue(id="LIVE_REP", timeout=120.)))
my_rec_program = audio_to_stereo(my_rec_tag(request.queue(id="MY_REC_PROGRAM", timeout=120.)))

#Music playlists
den = audio_to_stereo(den_tag(playlist("/home/radio/kavkaz.m3u")))

#Jingle playlist
jin = audio_to_stereo(jin_tag(playlist("/home/radio/jingle/")))

den = random(weights=[1,3],[jin,den])

music = switch(track_sensitive = true, [({6h00m00s-11h59m59s},den),({12h00m00s-17h59m59s},den),({18h00m00s-23h59m59s},den),({00h00m00s-5h59m59s},den)])

record = fallback(id="REC", track_sensitive = false, ([my_rec_program,live_rep]))
ready_air = fallback(id="STREAM", track_sensitive = false, ([
fallback.skip(input=live, nrj(fallback.skip(input=record,music))),
blank()
]))
ready_air = add([ready_air, amplify(1.,liveover)])
radio = smart_crossfade(ready_air)

output.icecast(%mp3(bitrate=192, samplerate = 44100, stereo = true), host = "185.58.204.182", port = 8000, name="My Radio", genre="various", url="http://185.58.204.182:8000", description="Мое интернет-радио", password = "S0105877s", mount = "/kavkaz.mp3", radio)
output.icecast(%mp3(bitrate=96, samplerate = 44100, stereo = false), host = "185.58.204.182", port = 8000, name="My Radio", genre="various", url="http://185.58.204.182:8000", description="Мое интернет-радио", password = "S0105877s", mount = "/dj.mp3", mean(radio))


/usr/etc/icecast.xml


<icecast>
<!-- Location and admin are two arbitrary strings that are e.g. visible
on the server info page of the icecast web interface
(server_version.xsl). -->
<location>UK</location>
<admin>radio</admin>

<limits>
<clients>100</clients>
<sources>2</sources>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- Same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints. -->
<burst-size>65535</burst-size>
<!--
<max-bandwidth>100M</max-bandwidth>
-->
</limits>

<authentication>
<!-- Sources log in with username 'source' -->
<source-password>S0105877s</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>S0105877s</relay-password>

<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>S0105877s</admin-password>
</authentication>

<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
-->

<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<hostname>185.58.204.182</hostname>

<!-- Set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/kavkaz.mp3</shoutcast-mount>
-->

<!-- port to use when talking to YP etc -->
<!--<port>8000</port> -->

<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
<!-- use <shoutcast-mount> in here to implicitly define port n+1 -->
</listen-socket>
<!--
<listen-socket>
<port>8001</port>
<ssl>1</ssl>
</listen-socket>
-->

<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->

<!--<master-username>hackme</master-username>-->
<!--<master-password>hackme</master-password>-->

<!-- issue above authentication for relays in slave setup -->
<!--<master-relay-auth>1</master-relay-auth>-->

<!-- setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 -->
<!--<relays-on-demand>1</relays-on-demand>-->


<!-- Request the master server to redirect new listeners to this slave
the details passed are based on <hostname> and <port> -->
<!--<master-redirect>1</master-redirect>-->

<!-- The maximum nuber of slaves that can register for new listener redirection. -->
<!--<max-redirect-slaves>10</max-redirect-slaves>-->



<!-- Relays. State connection information, and by default
request inline metadata for mp3 streams if available.
An on-demand relay will only retrieve the stream if
there are listeners connected -->
<!--
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/kazkaz.mp3</mount>
<local-mount>/test</local-mount>
<on-demand>1</on-demand>
<retry-delay>30</retry-delay>

<relay-shoutcast-metadata>0</relay-shoutcast-metadata>
</relay>
-->
<!-- Allow multiple master servers to be specified, tries each one in turn.
<relay>
<local-mount>/kazkaz.mp3</local-mount>
<server>a.b.c.d</server>
<timeout>6</timeout>
<master>
<port>8000</port>
<mount>/a</mount>
</master>
<master>
<port>80</port>
<mount>/</mount>
</master>
</relay>
-->

<!-- Only define a <mount> section if you want to use advanced options,
like alternative usernames or passwords
With a master/slave setup you need to define a mount in the master
or else the server will assume that the stream is not to be made
available to the slave.
<mount>
<mount-name>/dj.mp3</mount-name>

<username>radio</username>
<password>S0105877s</password>

<max-listeners>100</max-listeners>
<max-bandwidth>1000k</max-bandwidth>
<file-seekable>0</file-seekable>
<dump-file>/backup/live-%d-%b.ogg</dump-file>
<burst-size>65536</burst-size>
<fallback-mount>/kavkaz.mp3</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>
<intro>/path/to/stream-intro.ogg</intro>
<max-listener-duration>3600</max-listener-duration>
<hidden>1</hidden>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
<on-connect>/home/icecast/bin/stream-start</on-connect>
<on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
</mount>
-->
<!-- other auth possibilities include running a command
to do the auth, mount, user and pass are passed via
stdin to the program
<mount>
....
<authentication type="command">
<option name="listener_add" value="auth_verify"/>
</authentication>

or

for url auth, the add url needs to return a "icecast-auth-user:" http
header for a user to authenicate. URLs are sent params via POST.

<authentication type="url">
<option name="username" value="radio"/>
<option name="password" value="S0105877s"/>
<option name="handlers" value="3" />
<option name="stream_auth" value="http://myauthserver.com/scripts/auth_mount.php"/>
<option name="mount_add" value="http://myauthserver.com/scripts/add_mount.php"/>
<option name="mount_remove" value="http://myauthserver.com/scripts/del_mount.php"/>
<option name="listener_add" value="http://myauthserver.com/scripts/add_listener.php"/>
<option name="listener_remove" value="http://myauthserver.com/scripts/del_listener.php"/>
</authentication>
</mount>
-->

<fileserve>1</fileserve>

<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast</basedir>

<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<!--</usr/var/log/icecast>-->
<logdir>/home/radio/icecast</logdir>
<webroot>/usr/share/icecast/web</webroot>
<adminroot>/usr/share/icecast/admin</adminroot>
<!-- <pidfile>/usr/share/icecast/icecast.pid</pidfile> -->
<!-- <ssl-certificate>/usr/share/icecast/icecast.pem</ssl-certificate> -->
<!-- <deny-ip>/path/to/file-with-IPs</deny-ip> -->
<!-- <allow-ip>/path/to/file-with-IPs</allow-ip> -->
<!-- <deny-agents>/path/to/file-with-useragents</deny-agents> -->

<!-- location of mime types files used for file serving -->
<!-- <mime-types>/etc/mime.types</mime-types> -->

<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" dest="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for ********** to
the status page
-->
<alias source="/" dest="/index.html"/>
</paths>

<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!-- <accesslog_ip>0<accesslog_ip> -->
<!-- <playlistlog>playlist.log</playlistlog> -->
<loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
<!-- If logarchive is enabled (1), then when logsize is reached
the logfile will be moved to [error|access|playlist].log.DATESTAMP,
otherwise it will be moved to [error|access|playlist].log.old.
Default is non-archive mode (i.e. overwrite)
-->
<!-- <logarchive>1</logarchive> -->
</logging>

<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nogroup</group>
</changeowner>
-->
</security>
</icecast>



Запуск:
sudo /usr/bin/icecast -b start
sudo /usr/bin/liquidsoap -c /home/radio/start_liquidsoap.liq

Что я делаю не так?

419
gyurgin_ @gyurgin_
Первое что не так - это что не читаем что в конфигах написано.

419
gyurgin_ @gyurgin_
liquidsoap под рутом??

23
sergey_iron @sergey_iron
gyurgin_ пишет:

liquidsoap под рутом??


установлен или запускается?

23
sergey_iron @sergey_iron
при запуске
sudo liquidsoap -c /home/radio/start.liq

выдает ошибку:
Line 16, char 16 before "(": Parse error!

Не могу понять, на что ругается?


#!/usr/bin/liquidsoap
# где будут логи
set("log.file.path","/home/radio/radio.log")

# загружаем плейлист
myplaylist = mksafe(playlist("/home/radio/music.m3u")

#запускаем вещалку
output.icecast(%vorbis,
host = "185.58.204.182", port = 8000,
password = "S0105877s", mount = "123.mp3", myplaylist)