【问题标题】:Icecast Audio from source coming through all mount points来自所有挂载点的来自源的 Icecast 音频
【发布时间】:2017-08-26 04:46:18
【问题描述】:

我有一个 Icecast2 服务器,有 6 个挂载,由 Ices2 提供间歇性的 .ogg 音频流。当 Ices2 没有发送流时,它有一个后备挂载到静默.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>

【问题讨论】:

    标签: linux audio-streaming icecast


    【解决方案1】:

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

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

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

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

    旁注:仅在非常短暂的时间段内推荐回退到文件并且文件必须具有高比特率。否则,您最终会得到侦听器客户端的很多静默,因为没有真正的速率限制。这可能会导致玩家缓冲几分钟或几小时的沉默。

    【讨论】:

    • 谢谢!这样做的伎俩,但有点难看。你提到了覆盖设置,那有什么影响?我使用了文档中给出的后备示例,但没有找到对覆盖设置所做的令人满意的描述。
    • 覆盖有点用词不当。它使挂载能够在源客户端连接时将回退挂载的 所有 个当前侦听器传输到自身。又名反向。我想这可以更清楚地说明为什么常见的后备不是最佳选择。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 2012-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多