Stream data from Webcaster to Icecast

时光怂恿深爱的人放手 提交于 2021-01-29 09:20:15

问题


So i'm using the Webcaster Browser Client and I also got the Webcast NodeJS example server working locally as well. I'm receiving the data from the client in the server e.g

Mon Jul 16 2018 14:31:11 GMT+0300 (FLE Daylight Time) -- Got 1252 bytes of binary data

But I've been googling for a couple of days and can't seem to find information on how to actually pass those chunks of data to my Icecast server.

Additional Info that might be relevant: Icecast server : 2.4.3; Platform: Windows; Server is not running the liquidsoap example, it's the NodeJS one

Can someone point me in a direction or provide some sample code? Any help is greatly appreciated.


回答1:


Okay, so I've somehow managed to resolve my problem. Posting solution for any future reference if anyone needs help. Save this as script.liq:

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

# Serveur settings
set("harbor.bind_addr","0.0.0.0")

# An emergency file
emergency = single("./file.ogg")

# A playlist
playlist = playlist(mode="randomize",reload=60,"./music")

# A live source
livedj = input.harbor(
       "mount",
       port=8080,
       password="hackme"
)

# fallback
radio = fallback(track_sensitive=false,
                 [livedj,playlist,emergency])

# Stream it out
output.icecast(
    %mp3,
    host = "localhost",
    mount = "stream",
    user = "source",
    public = true,
    port = 8000, password = "hackme",
    genre = "Surprise",
    name = "DemoStream",
    radio)

Install Liquidsoap and run liquidsoap script.liq.

This configuration uses the default settings for an Icecast server so you only need to start up the Webcaster client and stream to ws://source:hackme@localhost:8080/mount. Cheers!



来源:https://stackoverflow.com/questions/51375379/stream-data-from-webcaster-to-icecast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!