sudo apt-get dist-upgrade // E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? sudo apt-get dist-upgrade --fix-missing apt-get install make sudo apt-get install g++ // Установка библиотек: apt-get install libshout-dev apt-get install libmp3lame-dev apt-get install libxml2-dev apt-get install libxslt1-dev apt-get install libvorbis-dev cd /tmp wget [url]http://curl.haxx.se/download/curl-7.45.0.tar.gz[/url] tar -zxvf curl-7.45.0.tar.gz cd curl-7.45.0 ./configure make make install // Установка icecast-2.4.2: // идем в темп cd .. // качаем исходник, тк желаем более свежую версию, чем в репозитариях wget [url]http://downloads.xiph.org/releases/icecast/icecast-2.4.2.tar.gz[/url] tar -zxvf icecast-2.4.2.tar.gz cd icecast-2.4.2 ./configure make make install // кажется установилось без ошибок // настраиваем /usr/local/etc/icecast.xml // сохраняемся и устанавливаем liquidsoap (тк впервые, то из репозитариев) apt-get install liquidsoap //установилса, кажется, liquidsoap (1.1.1-6ubuntu2) // создаем файл конфигурации: /usr/bin/liquidsoap.xml
#!/usr/bin/liquidsoap # Log dir set("log.file.path","/tmp/basic-radio.log") # Music myplaylist = playlist("~/radio/music.m3u") # Some jingles jingles = playlist("~/radio/jingles.m3u") # If something goes wrong, we'll play this security = single("~/radio/sounds/default.ogg") # Start building the feed with music radio = myplaylist # Now add some jingles radio = random(weights = [1, 4],[jingles, radio]) # And finally the security radio = fallback(track_sensitive = false, [radio, security]) # Stream it out output.icecast(%vorbis, host = "localhost", port = 8000, password = "hackme", mount = "basic-radio.ogg", radio)
liquidsoap 11.liq
- At line 1, char 1-3: The res...
- At line 1, char 1-4: The res...
- At line 1, char 8-9: The res...
# # A simple radio script to get started # Filenames need to be edited in playlist() and single() sources # message = "The Savonet team thanks you for using liquidsoap, " ^ "and we hope you'll enjoy it!" # Then we setup our icecast output function. # Possible options and values are bitrate=64, samplerate=11025, ... out = output.icecast(%vorbis,host="localhost") out(mount="demo.ogg", # The scheduler plays a randomized playlist, or the .ogg file # if the playlist fails to stream anything. The playlist can be made # of remote URIs. add([ # Comment out the next line if you don't have speech synthesis enabled. delay(10.,single("say:"^message)), # We add another output without the synthesized messages. It is not started # but you can turn it on using the server: # > telnet localhost 1234 # > novoice.ogg.start out(start=false,mount="novoice.ogg", fallback([ playlist("/your/favorite.m3u"), # The out(..) needs the single(..) to be infallible, # which requires a valid audio filename. single("/some/file.ogg") ])) ], weights=[5,1]))
#!/usr/local/bin/liquidsoap # создаём переменные быстрого исправления в одном месте по необходимости # базовая информация о выводимом потоке out = output.icecast( # хост с icecast host = "127.0.0.1", # его порт port = 8000, # логин user = "source", # и пароль password = "my_icecast2_password", # название name = "Интернет-радио", # жанр genre = "Rock", # ссылка на сайт url = "http://site", # кодировка encoding = "UTF-8" ) # включаем telnet-сервер set("server.telnet.bind_addr","127.0.0.1") set("server.telnet",true) # _____________________________________ # Описание файловой структуры нашего радиосервера. # Переменные можно не использовать, а писать сразу полные пути к плейлистам, но при изменении названия одной из папок, придётся править довольно много строк в конфигурации. Как показала практика, такой подход удобнее. # абсолютный путь к рабочей директории wd = "/home/botanica/web/my_domen.com/public_html" # путь к папке с аудиофайлами pl = "#{wd}/src/my_domen.com-radio" # техническая папка #tech = "#{pl}" # логи set("log.file.path","#{wd}/log/liquidsoap.log") # путь к файлу лога set("log.level", 4) # уровень логирования # папка с программами progr_dir = "#{pl}/programs" # папка с изменяющимся эфиром #ef = "#{pl}/efir" # папки соответствующих эфиров #ni = "#{ef}/night" #mo = "#{ef}/morning" #da = "#{ef}/daytime" #ev = "#{ef}/evening" # папки с музыкой #mus_ni_dir = "#{ni}/music" #mus_mo_dir = "#{mo}/music" #mus_da_dir = "#{da}/music" #mus_ev_dir = "#{ev}/music" mus_dir = "#{wd}/sto/my_domen.com-radio/music" # папки с джинглами #jin_ni_dir = "#{ni}/jingles" #jin_mo_dir = "#{mo}/jingles" #jin_da_dir = "#{da}/jingles" #jin_ev_dir = "#{ev}/jingles" jin_dir = "#{wd}/sto/my_domen.com-radio/jingles" # плейлисты с программами. Обратите внимание - до этого указывались пути к папкам, а здесь - к простым текстовым файлам. #1_prog_pl = "#{progr_dir}/1_prog.pl" #2_prog_pl = "#{progr_dir}/2_prog.pl" prog_pl = "#{progr_dir}/prog.pl" # _____________________________________ # Создаём объекты типа "source", в нашем случае это аудиоисточники. # Здесь атрибут "reload" позволяет раз в 360 секунд перечитывать плейлист по пути, указанному далее. # По умолчанию, музыка проигрывается рандомно, атрибут <code>mode = "normal"</code> указывает на проигрывание по порядку. # загружаем плейлисты, джинглы, вставки, программы mus = playlist (reload = 360, "#{mus_dir}") jin = playlist (reload = 360, "#{jin_dir}") prog = playlist (reload = 360, "#{prog_pl}", mode = "normal") # _____________________________________ # смешиваем вставки и потоки all = rotate (weights = [1, 1], [mus, jin]) #_______________________________________________________________________ # конфигурируем расписание эфира radio = switch (track_sensitive = true, [ ({ (1w21h - 1w22h) or (3w21h - 3w22h) or (5w21h - 5w22h)}, prog), ({ 2h - 1h }, all), ]) #_______________________________________________________________________ # добавляем crossfade radio = crossfade(start_next=1., fade_out=1., fade_in=1., radio) radio = mksafe(radio) # и, наконец, запускаем вещалки с разным качеством #out( # %vorbis.abr(samplerate = 44100, channels = 2, bitrate = 128, max_bitrate = 192, min_bitrate = 96), # description = "Average vorbis 96-128-192 Kbps", # mount = "HabraRadio_vorbis_avg_128", # mksafe(radio) #) #out( # %mp3(bitrate = 320, id3v2 = true), # description = "MP3 320 Kbps", # mount = "HabraRadio_320", # mksafe(radio) #) out( %mp3(bitrate = 192, id3v2 = true), description = "MP3 192 Kbps", mount = "HabraRadio_192", mksafe(radio) )
strange error flushing buffer ...
2015/10/28 17:25:41 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder. 2015/10/28 17:25:41 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2015/10/28 18:07:12 [request:3] Nonexistent file or ill-formed URI "/home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/programms/\208\159\208\176\209\128\208\176\208\180\208\190\208\186\209\129\209\139 \208\189\208\176\209\131\208\186\208\184/01_01_01.mp3"!
#!/usr/bin/liquidsoap # где будут логи #set("log.file.path","/tmp/test.log") set("log.file.path","/home/my_domen/web/my_domen.tk/public_html/log/my_domen.tk-radio/liquidsoap.log") # загружаем плейлист #myplaylist = playlist("/home/user/radio/music.m3u") myplaylist = playlist("/home/my_domen/web/my_domen.tk/public_html/src/my_domen.tk-radio/jingles_playlist.txt") #запускаем вещалку output.icecast(%vorbis, host = "localhost", port = 8000, password = "my_pass", mount = "live", myplaylist)
/home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/jingles/111/23.mp3 /home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/jingles/111/22.mp3 /home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/jingles/111/37.mp3 /home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/jingles/111/81.mp3 /home/my_domen/web/my_domen.tk/public_html/sto/my_domen.tk-radio/jingles/111/75.mp3
<icecast> <location>Orgrimmar</location> <admin>___________@mail.ru</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> <burst-on-connect>1</burst-on-connect> <burst-size>65535</burst-size> </limits> <authentication> <!-- Sources log in with username 'source' --> <source-password>my_pass</source-password> <!-- Relays log in with username 'relay' --> <relay-password>my_pass</relay-password> <!-- Admin logs in with the username given below --> <admin-user>admin</admin-user> <admin-password>my_pass</admin-password> </authentication> <hostname>***.***.***.***</hostname> <!-- You may have multiple <listener> elements --> <listen-socket> <port>8000</port> <!-- <bind-address>127.0.0.1</bind-address> --> <!-- <shoutcast-mount>/stream</shoutcast-mount> --> </listen-socket> <http-headers> <header name="Access-Control-Allow-Origin" value="*" /> </http-headers> <mount> <mount-name>/live</mount-name> <!--mount-name>/jingles</mount-name> <fallback-mount>/nonstop</fallback-mount--> <charset>utf-8</charset> <fallback-override>1</fallback-override> </mount> <fileserve>1</fileserve> <paths> <!-- basedir is only used if chroot is enabled --> <basedir>/usr/local/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 --> <logdir>/usr/local/var/log/icecast</logdir> <webroot>/usr/local/share/icecast/web</webroot> <adminroot>/usr/local/share/icecast/admin</adminroot> <!-- <pidfile>/usr/local/share/icecast/icecast.pid</pidfile> --> <alias source="/" destination="/status.xsl"/> <!-- The certificate file needs to contain both public and private part. Both should be PEM encoded. <ssl-certificate>/usr/local/share/icecast/icecast.pem</ssl-certificate> --> </paths> <logging> <accesslog>access.log</accesslog> <errorlog>error.log</errorlog> <!-- <playlistlog>playlist.log</playlistlog> --> <loglevel>4</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>
liquidsoap /home/my_domen/web/my_domen.tk/public_html/src/my_domen.tk-radio/start_liquidsoap
Invalid value at line 8, char 22-110: That source is fallible.
#запускаем вещалку output.icecast(%vorbis, host = "localhost", port = 8000, password = "my_pass", mount = "live", myplaylist)
#запускаем вещалку output.icecast(%vorbis, host = "localhost", port = 8000, password = "my_pass", mount = "live", mksafe(myplaylist))
<source-password>my_pass</source-password>
music = rotate(weights = [1, 2],[jingles, songs]) efir = fallback( [switch ([ ({00h57m00s-01h03m59s or 01h57m00s-02h03m59s or 02h57m00s-03h03m59s or 03h57m00s-04h03m59s or 04h57m00s-05h03m59s or 05h57m00s-06h03m59s or 06h57m00s-07h03m59s or 07h57m00s-08h03m59s or 08h57m00s-09h03m59s or 09h57m00s-10h03m59s or 10h57m00s-11h03m59s or 13h57m00s-14h03m59s or 14h57m00s-15h03m59s or 15h57m00s-16h03m59s or 16h57m00s-17h03m59s or 17h57m00s-18h03m59s or 18h57m00s-19h03m59s or 19h57m00s-20h03m59s or 20h57m00s-21h03m59s or 21h57m00s-22h03m59s or 22h57m00s-23h03m59s},clock), ({11h57m00s-12h03m59s or 23h57m00s-00h03m59s},clock_special), ({17m00s-23m59s},special1), ({47m00s-53m59s},special2) ]), music ])