如何优化liquidsoap?

时间:2015-07-24 09:22:36

标签: icecast transcoding internet-radio liquidsoap

我想通过Icecast传送~40个收音机并将它们转码为3比特率(32,64,128)

中继所有无线电并将它们转码为32位工作正常,但在64位,128位无法正常工作

Liquidsoap日志:

2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.04s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.02s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.

Liquidsoap config:

set("buffering.kind","raw")
set("log.file", true)

def my_input(url) =
    mksafe(input.http(buffer=5., max=20., url));
end

def outputs(name, mount, input) =
    output.icecast(
    %mp3(bitrate=32, samplerate=22050, stereo=false),
    ******
    mean(input))

    output.icecast(
    %mp3(bitrate=64,samplerate=44100,stereo=true),
    ******
    input)

    output.icecast(
    %mp3(bitrate=128,samplerate=44100,stereo=true),
    ******
    input)

end

url = "http://localhost:8000/radio1"
input = my_input(url)
outputs("Radio1", "radio1", input)

#..............

url = "http://localhost:8000/radio40"
input = my_input(url)
outputs("Radio40", "radio40", input)

Icecast限制:

enter image description here

服务器信息:

6 cores(average load 40%)
6GB RAM

htop屏幕: enter image description here

1 个答案:

答案 0 :(得分:2)

不幸的是,在这种情况下,负载是针对编解码器的,并且您无法做很多事情来减少它。在多个服务器之间拆分转码。

对于它的价值,我通常可以在最便宜的数字海洋盒上转换12个流。如果你还没有使用廉价的VPS主机,我推荐它!只需确保使用New Relic之类的东西监控CPU,如果他们切入你分配的周期,就转移到新主机。您的编解码器需要CPU的持续可用性以保持缓冲区满。

另外,我不知道您的源流是什么,但我强烈建议从无损源开始。有损编解码器降低了质量,在链中使用多个编解码器会进一步降低质量。