1
所以我有Liquidsoap的一個實例,在端口8080Liquidsoap錄製過的所有文件輸出文件夾
海港輸入,我想什麼有發生的情況是,每當有人連接/直播,流是記錄並保存在服務器上。
但是,如果例如我正在錄製,然後斷開連接並允許播放列表踢入,當我嘗試再次流式傳輸時,它會創建一個新文件,但會開始寫入新文件和先前的錄製。
它基本上是寫第一個文件。這種情況不會發生的唯一方法就是如果液態肥皂在兩次廣播之間重新啓動。
這裏是我的LIQ文件的副本:
#!/usr/bin/liquidsoap
# Don't create a pidfile
#set("init.daemon.pidfile",false)
# Create Log File
set("log.file.path","/tmp/ls-log.log")
set("log.file.perms",755)
set("log.unix_timestamps",true)
# DJ or Metadata IP Address
set("harbor.bind_addr","0.0.0.0")
# Port/Pass for Live DJs
live = input.harbor(id="live",port=8080,password="xxxxxx", "live")
# Find /home/music/ -type f -name "*.mp3" > /etc/liquidsoap/music.m3u
# Path to playlist file which contains a list of local mp3's (/home/user/mp3/song.mp3)
playlist = playlist("./home/taskone/stream/playlists/dubstep/playlist.txt")
# Path to backup track if other streams fail
backup = single("./home/taskone/stream/backups/dubstep/Task One - Studio Sessions.mp3")
# Do not monitor for radio silence and also specify the expected play order
radio = fallback(track_sensitive=false,[live, playlist, backup])
# Function to manually change song title
title = insert_metadata(radio)
insert = fst(title)
radio = snd(title)
def set_meta(~protocol,~data,~headers,uri) =
title = url.split(uri)
meta = metadata.export(snd(title))
show_title = meta["title"]
ret = if meta != [] then insert(meta) "Title Updated - #{show_title}" else "No metadata to add!" end
http_response(protocol=protocol,code=200,headers=[("Content-Type","text/html")],data="<html><body><b>#{ret}</b></body></html>") end
# Port to register metadata updates via http
harbor.http.register(port=8080,method="GET","/setmeta",set_meta)
# dump live_dj recordings to a file
timestamp = '%d-%m-%Y'
show_title = 'XXXXXXX'
output.file(%mp3(bitrate=320, id3v2=true), reopen_on_metadata=false, "/var/www/html/recorded_shows/#{show_title} Recorded On #{timestamp}.mp3", live, fallible=true)
# Output to an Icecast Server
output.icecast(
%mp3(bitrate=192),
mount="/stream",
host="localhost", port=8000, password="XXXXXXXX",
radio)