Valdir
Valdir

Reputation: 515

Setup webcaster (webcast.js) with liquidsoap and icecast

I'm testing Webcast.js using liquid soap. So far I've connected the Webcaster demo to the liquidsoap server running with the following command liquidsoap "output.ao(fallible=true,audio_to_stereo(input.harbor('mount',port=8080)))"

Now I want to connect liquidsoap to an Icecast server and get an URL in order to listen the streaming.

I've read the documentation of liquidsoap and it shows the following example:

liquidsoap 
  'output.icecast(%vorbis,
     host = "localhost", port = 8000, \
     password = "hackme", mount = "liq.ogg", \
     mksafe(playlist("playlist.m3u")))'

I was able to get the streaming only with liquidsoap using input.harbor. How do I change it to send to Icecast? Do I need to create a configuration file?

In the liquidsoap's example it references a playlist.m3u and I want the livestream.

Upvotes: 0

Views: 1857

Answers (1)

Valdir
Valdir

Reputation: 515

Save the following as script.liq and run liquidsoap script.liq

#!/usr/bin/liquidsoap

# Log dir
set("log.file.path","/tmp/some-radio.log")

# Live DJ stuff
set("harbor.bind_addr","0.0.0.0")
set("harbor.verbose",true)
livedj = input.harbor(
       "mount",
       port=8080,
       password="hackme"
)

# If something goes wrong, we'll play this
#security = single("/home/osboxes/Documents/liquidsoap/error.mp3")

# Set Radio
radio = fallback(track_sensitive = false, [livedj])


# Stream it out
output.icecast(
        %mp3(bitrate=128),
        fallible=true,
        host = "localhost",
        port = 8000,
        password = "hackme",
        mount = "master",
        radio
)

Upvotes: 1

Related Questions