Inhaltsverzeichnis

Liquidsoap



Liquidsoap ist ein Multifunktions Werkzeug zur Bereitstellung von Multimedia Inhalten. Die Software bezeichnet sich, laut Projektseite als Schweizer Messer in Bezug auf Multimedia Streaming. Unter anderem können mit Liquidsoap, Multimedia Dateien an Icecast2 gesendet werden. Viele Linux Distributionen stellen Liquidsoap über die Softwarequellen der Paketverwaltung bereit.



Liquidsoap installieren



Die Installation von Liquidsoap sieht bei Systeme folgendend aus.

root@home:~# apt install liquidsoap




Gewünschte Module können zusätzlich installiert werden.

root@home:~# apt-cache search liquidsoap-plugin-*
liquidsoap-plugin-all - audio streaming language -- all plugins
liquidsoap-plugin-alsa - audio streaming language -- ALSA plugin
liquidsoap-plugin-ao - audio streaming language -- AO plugin
liquidsoap-plugin-camlimages - audio streaming language -- Camlimages plugin
liquidsoap-plugin-dssi - audio streaming language -- DSSI plugin
liquidsoap-plugin-faad - audio streaming language -- FAAD plugin
liquidsoap-plugin-flac - audio streaming language -- FLAC plugin
liquidsoap-plugin-frei0r - audio streaming language -- Frei0r plugin
...




Bei der Installation wird der Benutzer, die Gruppe „liquidsoap“ und folgende Verzeichnisse angelegt.

root@home:~# find / -name liquidsoap
/usr/lib/liquidsoap
/usr/bin/liquidsoap
/usr/share/doc/liquidsoap
/usr/share/doc-base/liquidsoap
/usr/share/liquidsoap
/var/log/liquidsoap
/run/liquidsoap
/etc/liquidsoap
/etc/init.d/liquidsoap
/etc/logrotate.d/liquidsoap





Liquidsoap einrichten



Die Haupt Konfigurationsdatei befindet sich im Verzeichnis „/etc/liquidsoap“.

root@home:/etc/liquidsoap# ll
-rwxr-xr-x 1 root root 1153 Mai  9  2013 radio.liq.example



Zum einrichten kann die Datei „radio.liq.example“ als Muster verwendet und z.B. in „radio-xxx.liq“ umbenannt und bearbeitet werden.

root@home:/etc/liquidsoap# cat radio.liq.example
#
# 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]))




Steuerungs Syntax




Optionen





root@home:/etc/liquidsoap# liquidsoap -c "/etc/liquidsoap/radio-xxx.liq"


Mit der Option „-c“ kann die Konfigurationsdatei geprüft werden. Wenn alles in Ordnung ist, wird keine Meldung ausgegeben.


Start / Stop Liquidsoap





root@home:/etc/liquidsoap# ps aux | grep liquidsoap
liquids+ 26298 30.7  2.0 123968 20024 ?        Sl   02:36   0:08 /usr/bin/liquidsoap -d /etc/liquidsoap/radio-xxx.liq


Prüfen, ob der Liquidsoap Dienst läuft.


FIXME



Konfigurationsbeispiele



XML Dateien einlesen und in zufälliger Reihenfolge nach Gewichtung über Icecast2 ausgeben.

root@home:/etc/liquidsoap# cat radio-xxx.liq
#!/usr/bin/liquidsoap
# Log dir
# set("log.file.path","/var/log/liqidsoap/liqidsoap.log")
#
myplaylist = playlist("/path/to/playlist/play_1.xml")

jingles = playlist("/path/to/playlist/play_2.xml")

merch = playlist("/path/to/playlist/play_3.xml")

security = single("/path/to/audiofile.ogg")

radio = myplaylist
radio = random(weights = [1, 3, 7],[merch, jingles, radio])

radio = fallback(track_sensitive = false, [radio, security])

output.icecast(%mp3, host = "192.168.0.XX", port = 8000, password = "Icecast2 Source Passwort", mount = "/playlist.m3u", radio)



FIXME



Quellen








Cloud