首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自源的Icecast音频通过所有安装点

来自源的Icecast音频通过所有安装点
EN

Stack Overflow用户
提问于 2017-08-25 20:17:42
回答 1查看 730关注 0票数 0

我有一个Icecast2服务器,有6个挂载由Ices2提供间歇的.ogg音频流。当流不是由Ices2发送时,它有一个回退挂载到一个silence.ogg,它使流继续运行,直到Ices2再次连接到挂载为止。

问题是,无论我连接到哪个挂载点,我都从所有其他Ices2提要接收流。

这是我的icecast.xml:

代码语言:javascript
复制
<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>

EN

回答 1

Stack Overflow用户

发布于 2017-08-25 20:46:18

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

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

在Icecast中,所有客户端在挂载点的上下文中都是无状态的。这意味着,一旦侦听器从/mountX.ogg传输到/silent.ogg,就不会有任何影响后续行为的初始挂载点的概念。这意味着,如果现在/mountY.ogg能够上线,它将抓取/silent.ogg的所有当前客户端,以便覆盖。

拆开这种装置的一种方法是有不相交的后援链。例如/mountX.ogg/silentX.ogg等。

sidenote:只建议在非常短的时间内回退到文件,并且文件必须具有较高的比特率。否则,侦听器客户端就会被喂食大量的沉默,因为没有实际的速率限制。这会导致玩家缓冲数分钟或数小时的沉默。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45888833

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档