Icecast Audio来自所有挂载点

时间:2017-08-25 20:17:43

标签: linux audio-streaming icecast

我有一台Icecast2服务器,其中6个安装由Ices2提供间歇性的.ogg音频流。当Ices2没有发送流时,它有一个后备挂载到silence.ogg,使流保持直到Ices2再次连接到挂载。

问题在于无论我连接到哪个挂载点,我都会收到来自所有其他Ices2订阅源的流。

这是我的icecast.xml:

<icecast>
<location>Toronto</location>
<admin>webmaster@example.com</admin>

<limits>
    <clients>100</clients>
    <sources>10</sources>
    <queue-size>524288</queue-size>
    <client-timeout>30</client-timeout>
    <header-timeout>15</header-timeout>
    <source-timeout>100</source-timeout>
     <burst-size>65535</burst-size>
</limits>

<authentication>
    <!-- Sources log in with username 'source' -->
    <source-password>hackme</source-password>
    <!-- Relays log in username 'relay' -->
    <relay-password>hackme</relay-password>

    <!-- Admin logs in with the username given below -->
    <admin-user>admin</admin-user>
    <admin-password>changeMe</admin-password>
</authentication>

<hostname>sound.example.com</hostname>

<!-- You may have multiple <listener> elements -->
<listen-socket>
    <port>8000</port>
    <ssl>1</ssl>
</listen-socket>
<listen-socket>
    <port>8001</port>
</listen-socket>

<relays-on-demand>0</relays-on-demand>

<mount> 
    <mount-name>/mount1.ogg</mount-name> 
    <max-listeners>5</max-listeners> 
    <max-listener-duration>36000</max-listener-duration> 
    <burst-size>65536</burst-size>
    <fallback-mount>/silent.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>  
        <public>0</public>    
</mount> 
<mount> 
     <mount-name>/mount2.ogg</mount-name> 
    <max-listeners>5</max-listeners> 
    <max-listener-duration>36000</max-listener-duration> 
    <burst-size>65536</burst-size>      
    <fallback-mount>/silent.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>      
        <public>0</public>    
</mount> 
<mount> 
    <mount-name>/mount3.ogg</mount-name> 
    <max-listeners>5</max-listeners> 
    <max-listener-duration>36000</max-listener-duration> 
    <burst-size>65536</burst-size>      
    <fallback-mount>/silent.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>      
        <public>0</public>    
</mount> 
<mount> 
    <mount-name>/mount4.ogg</mount-name> 
    <max-listeners>5</max-listeners> 
    <max-listener-duration>36000</max-listener-duration> 
    <burst-size>65536</burst-size>      
    <fallback-mount>/silent.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>      
        <public>0</public>    
</mount> 
<mount> 
    <mount-name>/mount5.ogg</mount-name> 
    <max-listeners>5</max-listeners> 
    <max-listener-duration>36000</max-listener-duration> 
    <burst-size>65536</burst-size>      
    <fallback-mount>/silent.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>      
        <public>0</public>    
</mount>     

<fileserve>1</fileserve>

<paths>
    <!-- basedir is only used if chroot is enabled -->
    <basedir>/usr/share/icecast2</basedir>

    <!-- Note that if <chroot> is turned on below, these paths must both
         be relative to the new root, not the original root -->
    <logdir>/var/log/icecast2</logdir>
    <webroot>/usr/share/icecast2/web</webroot>
    <adminroot>/usr/share/icecast2/admin</adminroot>
    <ssl-certificate>/etc/icecast2/fullchain.pem</ssl-certificate>

    <alias source="/" destination="/status.xsl"/>
</paths>

<logging>
    <accesslog>access.log</accesslog>
    <errorlog>error.log</errorlog>
    <!-- <playlistlog>playlist.log</playlistlog> -->
    <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
    <logsize>10000</logsize> <!-- Max size of a logfile -->
</logging>

<security>
    <chroot>0</chroot>

</security>

1 个答案:

答案 0 :(得分:1)

所有挂载都回退到同一个流(或者是一个文件?):/silent.ogg

由于所有挂载点也启用了覆盖,因此可能不会产生预期的行为。

在Icecast中,所有客户端在挂载点的上下文中都是无状态的。这意味着一旦将侦听器从/mountX.ogg转移到/silent.ogg,就不会对原始挂载点产生任何影响后续行为的概念。这意味着,如果现在/mountY.ogg将联机,那么由于覆盖,它会抓取所有当前/silent.ogg客户端。

解开这种设置的一种方法是使用不相交的回退链。例如/mountX.ogg/silentX.ogg等等。

旁注:仅建议非常短暂的文件必须具有高比特率的回退到文件。否则,你最终会得到一个静音的很多的听众客户端,因为没有真正的速率限制。这可能导致玩家沉默数分钟或数小时。