如何为IceCast服务器设置回退文件?
如果你碰巧正在使用一个非常有用的工具集liquidsoap和icecast2,那么你应该会对下面的例子感到兴奋,它将播放一个目录的声音文件,或者如果有一个直播流广播,那么它将淡出播放列表,播放"jingle"声音文件,然后淡出直播流。除了愚蠢的url,这是从一个工作环境中提取的。
安装liquidsoap和安装apt-get一样无痛。如果你想使用mp3,那么apt-get install lame,然后切换到output. iccast .lame()。创建一个扩展名为.liq的文件(example.liq),然后使用chmod +x example。Liq和你出发去。/赛马
#!/usr/bin/liquidsoap
# use the -d flag for daemon mode
set("log.file",false)
set("log.stdout",true)
set("log.level",3)
set("harbor.icy",true)
default = single("say:How are you gentlemen!!
all your base are belong to us.
You are on the way to destruction.
What you say!!
You have no chance to survive make your time!
HA! HA! HA! HA! HA!")
jingles = playlist("/home/edward/micronemez-jinglez")
audio = playlist("/home/edward/micronemez-ogg")
#liveset = mksafe(input.http("http://audio.micronemez.com"))
liveset = strip_blank(input.http("http://f-dt.com"))
liveset = rewrite_metadata([("artist", "FUTURE__DEATH__TOLL"),("title", "LIVE FROM YELLOW_HOUSE")], liveset)
radio = fallback(track_sensitive=false,
[skip_blank(liveset), audio, default])
radio = random(weights=[1,5],[ jingles, radio ])
output.icecast.vorbis(
host="futuredeathtoll.com",port=8000,password="hackme",
genre="Easy Listening",url="http://f-dt.com",
description="pirate radio",mount="micronemez-radio.ogg",
name="FUTURE__DEATH__TOLL ((YELLOW_HOUSE))",radio)
一些非常有用的链接:
http://savonet.sourceforge.net/doc-svn/cookbook.html http://oshyn.com/_blog/General/post/Audio_and_Video_Streaming_with_Liquidsoap_and_Icecast/http://wiki.sourcefabric.org/display/LS/WikiStartFrom the doc:
fallback-mount>/example2.ogg</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>`
请参阅icecast2_config_file获取更多解释滚动到回退挂载描述